34 #include "contiki-conf.h"
35 #include "sys/node-id.h"
37 unsigned short node_id = 0;
44 uint8_t
volatile sreg;
48 eeprom_read(EEPROM_NODE_ID_START, (
unsigned char *)newid,
sizeof(newid));
49 node_id = (newid[0] == 0xdead) ? newid[1] : 0;
54 node_id_burn(
unsigned short id)
56 uint16_t buffer[2] = { 0xdead,
id };
57 uint8_t
volatile sreg;
61 eeprom_write(EEPROM_NODE_ID_START, (
unsigned char *)buffer,
sizeof(buffer));
void eeprom_read(eeprom_addr_t addr, unsigned char *buf, int size)
Read data from the EEPROM.
void eeprom_write(eeprom_addr_t addr, unsigned char *buf, int size)
Write a buffer into EEPROM.