Mercurial > public > ostc4
diff Discovery/Src/base.c @ 427:b1091e183d52 ImprovmentNVM_2
Activated ringbuffer for settings:
In previous versions the settings have always been writte to the ring start address causing additional ~200ms for sector erase. The settings are now continously written (~8ms). At shutdown the settings are written to ring start for compability reasons.
In case of a reset the SW will scan the ringbuffer for the latest available block and restore it.
author | ideenmodellierer |
---|---|
date | Sun, 16 Feb 2020 22:04:52 +0100 |
parents | b67327177159 |
children | f1257a32f2d4 |
line wrap: on
line diff
--- a/Discovery/Src/base.c Sat Feb 15 20:50:58 2020 +0100 +++ b/Discovery/Src/base.c Sun Feb 16 22:04:52 2020 +0100 @@ -455,7 +455,7 @@ if( settingsGetPointer()->debugModeOnStart ) { settingsGetPointer()->debugModeOnStart = 0; - ext_flash_write_settings(); + ext_flash_write_settings(0); setDebugMode(); openInfo( StIDEBUG ); } @@ -481,14 +481,14 @@ { createDiveSettings(); updateMenu(); - ext_flash_write_settings(); + ext_flash_write_settings(0); } /* check if tasks depending on global state are pending */ get_globalStateList(&status); if(status.base == BaseHome) { - tMenuEdit_writeSettingsToFlash(); // takes 900 ms!! + tMenuEdit_writeSettingsToFlash(); } DataEX_merge_devicedata(); /* data is exchanged at startup and every 10 minutes => check if something changed */ @@ -920,6 +920,7 @@ // ext_flash_erase_firmware_if_not_empty(); GFX_logoAutoOff(); ext_flash_write_devicedata(true); /* write data at default position */ + ext_flash_write_settings(true); /* write data at default position */ set_globalState(StStop); }