static uint16_t
get_panaddr_from_eeprom(void) {
#if JACKDAW_CONF_USE_SETTINGS
	return settings_get_uint16(SETTINGS_KEY_PAN_ADDR, 0);
#else
	// TODO: Writeme!
	return 0;
#endif
}
static uint16_t
get_panid_from_eeprom(void) {
#if JACKDAW_CONF_USE_SETTINGS
	uint16_t x = settings_get_uint16(SETTINGS_KEY_PAN_ID, 0);
	if(!x)
		x = IEEE802154_PANID;
	return x;
#else
	// TODO: Writeme!
	return IEEE802154_PANID;
#endif
}
Beispiel #3
0
static uint16_t get_panaddr_from_eeprom(void) {
    uint16_t x;
    if (settings_check(SETTINGS_KEY_PAN_ADDR,0)) {
        x = settings_get_uint16(SETTINGS_KEY_PAN_ADDR,0);
        PRINTD("<-Get EEPROM PAN address of %04x.\n",x);
    } else {
	    x=pgm_read_word_near(&default_panaddr);
        if (settings_add_uint16(SETTINGS_KEY_PAN_ADDR,x)==SETTINGS_STATUS_OK) {
          PRINTA("->Set EEPROM PAN address to %04x.\n",x);
        }
    }        
	return x;
}