Fixed EEPROM macro. Added Max_Master get/save from EEPROM.

This commit is contained in:
skarg
2010-06-01 19:58:52 +00:00
parent ed40541c36
commit 44da26484d
2 changed files with 10 additions and 6 deletions
+8 -5
View File
@@ -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);
}
}
+2 -1
View File
@@ -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