diff --git a/src/flash.c b/src/system/flash.c copy from src/flash.c copy to src/system/flash.c --- a/src/flash.c +++ b/src/system/flash.c @@ -8,8 +8,9 @@ // Takes up 1 page (1k size) static __attribute__((__section__(".eeprom"))) uint16_t eeprom_emulation[512]; -settings_t settings; +therm_settings_t settings; +therm_status_t status; // Initialize flash and restore settings void flash_init(void) @@ -19,7 +20,7 @@ void flash_init(void) // Save settings to flash memory -void flash_savesettings(void) +void flash_savesettings() { // Unlock flash memory HAL_FLASH_Unlock(); @@ -68,13 +69,23 @@ void flash_restoresettings(void) // No data in flash! Set defaults here else { - settings.values.can_id = 22; + settings.val.k_p = 10; + settings.val.k_i = 0; + settings.val.k_d = 0; + settings.val.windup_guard = 300; + //torestore.values.can_id = 22; } } // Accessor to retrieve settings structure -inline settings_t* flash_getsettings(void) +inline therm_settings_t* flash_getsettings(void) { return &settings; } + +inline therm_status_t* runtime_status(void) +{ + return &status; +} +