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