From 8bedc79d1511e2b3cb4998669beb27d84b42adc6 Mon Sep 17 00:00:00 2001 From: gitknilch Date: Thu, 24 Mar 2011 19:18:29 +0100 Subject: [PATCH] init eeprom --- firmware/fnordlicht-firmware/storage.c | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/firmware/fnordlicht-firmware/storage.c b/firmware/fnordlicht-firmware/storage.c index 637ad69..0ad522d 100644 --- a/firmware/fnordlicht-firmware/storage.c +++ b/firmware/fnordlicht-firmware/storage.c @@ -29,7 +29,34 @@ /* 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, /* FIXME expected to be 0 atm */ + /* uint8_t program_parameters[PROGRAM_PARAMETER_SIZE] */ + /* FIXME: hardcoded parameters for colorwheel */ + 1u, 2u, 0, 0, 0, 0, 60u, 0, 255u, 255u + } + } + }, + /* struct storage_color_t color[CONFIG_EEPROM_COLORS] */ + { + 0u, + }, + /* uint16_t checksum */ + 0x2323u /* FIXME */ +}; /* internal state */ struct storage_internal_t -- 2.39.2