X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/fnordlicht-mini/blobdiff_plain/ec1bef8e19888e982ffc53129f74d58868e8d203..5911f50bafb9409a3b1ca483cbe2510aeb3c0d4f:/firmware/fnordlicht-firmware/storage.c diff --git a/firmware/fnordlicht-firmware/storage.c b/firmware/fnordlicht-firmware/storage.c index 637ad69..7012dac 100644 --- a/firmware/fnordlicht-firmware/storage.c +++ b/firmware/fnordlicht-firmware/storage.c @@ -29,7 +29,40 @@ /* global structures */ struct storage_config_t startup_config; -EEMEM struct storage_t eeprom_storage; +EEMEM struct storage_t eeprom_storage = +{ + /* struct storage_config_t config */ + { + /* uint8_t magic */ + EEPROM_MAGIC_BYTE, + /* uint8_t startup_addr */ + 1u, + /* struct startup_parameters_t params */ + { + /* enum startup_mode_t mode */ + STARTUP_PROGRAM, + { + /* uint8_t program */ + CONFIG_SCRIPT_DEFAULT, + /* uint8_t program_parameters[PROGRAM_PARAMETER_SIZE] */ + /* these are taken from script.c */ +#if CONFIG_SCRIPT_DEFAULT == 0 + /* parameters for colorwheel */ + 1u, 2u, 0, 0, 0, 0, 60u, 0, 255u, 255u +#elif CONFIG_SCRIPT_DEFAULT == 1 + /* parameters for random */ + 0, 23u, 2u, 1u, 3u, 0, 100u, 255u, 255u, 60u +#endif + } + } + }, + /* struct storage_color_t color[CONFIG_EEPROM_COLORS] */ + { + 0u, + }, + /* uint16_t checksum */ + 0x2323u /* FIXME */ +}; /* internal state */ struct storage_internal_t