Fixed EEPROM macro. Added Max_Master get/save from EEPROM.
This commit is contained in:
@@ -45,6 +45,8 @@
|
|||||||
#include "bytes.h"
|
#include "bytes.h"
|
||||||
#include "bacaddr.h"
|
#include "bacaddr.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "eeprom.h"
|
||||||
|
#include "nvdata.h"
|
||||||
|
|
||||||
/* This file has been customized for use with small microprocessors */
|
/* This file has been customized for use with small microprocessors */
|
||||||
/* Assumptions:
|
/* Assumptions:
|
||||||
@@ -242,6 +244,11 @@ bool dlmstp_init(
|
|||||||
{
|
{
|
||||||
ifname = ifname;
|
ifname = ifname;
|
||||||
|
|
||||||
|
eeprom_bytes_read(NV_EEPROM_MAX_MASTER, &Nmax_master, 1);
|
||||||
|
if (Nmax_master > 127) {
|
||||||
|
Nmax_master = 127;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1303,11 +1310,7 @@ void dlmstp_set_max_master(
|
|||||||
if (max_master <= 127) {
|
if (max_master <= 127) {
|
||||||
if (This_Station <= max_master) {
|
if (This_Station <= max_master) {
|
||||||
Nmax_master = max_master;
|
Nmax_master = max_master;
|
||||||
/* FIXME: implement your data storage */
|
eeprom_bytes_write(NV_EEPROM_MAX_MASTER, &max_master, 1);
|
||||||
/* I2C_Write_Byte(
|
|
||||||
EEPROM_DEVICE_ADDRESS,
|
|
||||||
max_master,
|
|
||||||
EEPROM_MSTP_MAX_MASTER_ADDR); */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -211,7 +211,8 @@ typedef struct {
|
|||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#include <avr/eeprom.h>
|
#include <avr/eeprom.h>
|
||||||
#define EEPROM_DECLARE(x) x __attribute__((section (".eeprom")))
|
#define EEPROM_DECLARE(x) x __attribute__((section (".eeprom")))
|
||||||
#if ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)))
|
#if ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)) || \
|
||||||
|
((__GNUC__ == 4) && (__GNUC_MINOR__ == 3) && (__GNUC_PATCHLEVEL__ < 4)))
|
||||||
/* bug in WinAVR - not quite IAR compatible */
|
/* bug in WinAVR - not quite IAR compatible */
|
||||||
#define __EEPUT _EEPUT
|
#define __EEPUT _EEPUT
|
||||||
#define __EEGET _EEGET
|
#define __EEGET _EEGET
|
||||||
|
|||||||
Reference in New Issue
Block a user