add BOOTLOADER_GET_MAC
This commit is contained in:
parent
b27469d218
commit
611e358ad9
|
@ -43,6 +43,12 @@ AVRDUDE_PORT=usb:00B000000D79
|
||||||
# Verify off
|
# Verify off
|
||||||
AVRDUDE_OPTIONS=-V
|
AVRDUDE_OPTIONS=-V
|
||||||
|
|
||||||
|
#debug
|
||||||
|
# CFLAGS += -save-temps
|
||||||
|
# Bootloader bonsai
|
||||||
|
# LDFLAGS += -save-temps
|
||||||
|
LDFLAGS += -Wl,--defsym,bootloader_get_mac=0x0001f3a0
|
||||||
|
|
||||||
|
|
||||||
include $(CONTIKIAVR)/Makefile.avr
|
include $(CONTIKIAVR)/Makefile.avr
|
||||||
include $(CONTIKIAVR)/radio/Makefile.radio
|
include $(CONTIKIAVR)/radio/Makefile.radio
|
||||||
|
|
|
@ -84,6 +84,9 @@ const uint8_t default_domain_name[] PROGMEM = PARAMS_DOMAINNAME;
|
||||||
|
|
||||||
#if PARAMETER_STORAGE==0
|
#if PARAMETER_STORAGE==0
|
||||||
/* 0 Hard coded, minmal program and eeprom usage. */
|
/* 0 Hard coded, minmal program and eeprom usage. */
|
||||||
|
|
||||||
|
extern uint8_t bootloader_get_mac(uint8_t);
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
params_get_eui64(uint8_t *eui64) {
|
params_get_eui64(uint8_t *eui64) {
|
||||||
#if CONTIKI_CONF_RANDOM_MAC
|
#if CONTIKI_CONF_RANDOM_MAC
|
||||||
|
@ -92,7 +95,13 @@ params_get_eui64(uint8_t *eui64) {
|
||||||
return 1;
|
return 1;
|
||||||
#else
|
#else
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
#if BOOTLOADER_GET_MAC
|
||||||
|
for (i=0;i<sizeof(default_mac_address);i++){
|
||||||
|
eui64[i] = bootloader_get_mac(i);
|
||||||
|
}
|
||||||
|
#else
|
||||||
for (i=0;i<sizeof(default_mac_address);i++) eui64[i] = pgm_read_byte_near(default_mac_address+i);
|
for (i=0;i<sizeof(default_mac_address);i++) eui64[i] = pgm_read_byte_near(default_mac_address+i);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,14 @@
|
||||||
*/
|
*/
|
||||||
#define CONTIKI_CONF_RANDOM_MAC 0 //adds 78 bytes
|
#define CONTIKI_CONF_RANDOM_MAC 0 //adds 78 bytes
|
||||||
#define CONTIKI_CONF_SETTINGS_MANAGER 0 //adds 1696 bytes
|
#define CONTIKI_CONF_SETTINGS_MANAGER 0 //adds 1696 bytes
|
||||||
|
#define BOOTLOADER_GET_MAC 0 // get mac form boolaoder, need bootlaoder bonsai, PARAMETER_STORAGE 0
|
||||||
|
|
||||||
#if CONTIKI_CONF_SETTINGS_MANAGER
|
#if CONTIKI_CONF_SETTINGS_MANAGER
|
||||||
//#define PARAMETER_STORAGE 2
|
//#define PARAMETER_STORAGE 2
|
||||||
#define PARAMETER_STORAGE 2
|
#define PARAMETER_STORAGE 2
|
||||||
#else
|
#else
|
||||||
#define PARAMETER_STORAGE 1
|
//#define PARAMETER_STORAGE 1
|
||||||
|
#define PARAMETER_STORAGE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Include settings.h, then dummy out the write routines */
|
/* Include settings.h, then dummy out the write routines */
|
||||||
|
@ -73,7 +75,7 @@ extern uint8_t eemem_domain_name[30];
|
||||||
#if UIP_CONF_LL_802154
|
#if UIP_CONF_LL_802154
|
||||||
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN}
|
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN, 0xNN}
|
||||||
//#define PARAMS_EUI64ADDR {0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x01}
|
//#define PARAMS_EUI64ADDR {0x02, 0x00, 0x00, 0xff, 0xfe, 0x00, 0x00, 0x01}
|
||||||
#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x26, 0x6c}
|
#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x26, 0xd0}
|
||||||
//#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x1E, 0xFB}
|
//#define PARAMS_EUI64ADDR {0x00, 0x21, 0x2e, 0xff, 0xff, 0x00, 0x1E, 0xFB}
|
||||||
#else
|
#else
|
||||||
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xff, 0xfe, 0xNN, 0xNN, 0xNN}
|
//#define PARAMS_EUI64ADDR {0x02, 0xNN, 0xNN, 0xff, 0xfe, 0xNN, 0xNN, 0xNN}
|
||||||
|
|
Loading…
Reference in a new issue