{
/* if configuration is valid */
if (storage_valid_config()) {
+ /* set global address to stored value */
+ global_remote.address = startup_config.startup_addr;
/* read default mode from storage (do nothing if mode is invalid) */
if (startup_config.params.mode == STARTUP_PROGRAM) {
#define EEPROM_MAGIC_BYTE 0x23
/* store the startup configuration in EEPROM
- * size: 13 byte */
+ * size: 14 bytes */
struct storage_config_t
{
/* magic byte, must match EEPROM_MAGIC_BYTE to mark a valid configuration */
uint8_t magic;
- /* startup parameters, defined in remote_proto.h, size: 12 byte */
+ /* initial node address to use at startup */
+ uint8_t startup_addr;
+ /* startup parameters, defined in remote_proto.h, size: 12 bytes */
struct startup_parameters_t params;
};
/* storage structure for EEPROM
- * size: 494 byte
- * (means: 18 byte left) */
+ * size: 496 bytes
+ * (means: 16 bytes left) */
struct storage_t
{
- /* startup configuration, size: 12 byte */
+ /* startup configuration, size: 14 bytes */
struct storage_config_t config;
- /* color storage, size: 60*8 == 480 byte */
+ /* color storage, size: 60*8 == 480 bytes */
struct storage_color_t color[CONFIG_EEPROM_COLORS];
- /* crc16 checksum over config and color[], size: 2 byte */
+ /* crc16 checksum over config and color[], size: 2 bytes */
uint16_t checksum;
};