Mercurial > public > ostc4
diff Discovery/Src/base.c @ 416:bcf447646e07
Merged in Ideenmodellierer/ostc4/Improment_NVM (pull request #37)
Improment NVM
| author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
|---|---|
| date | Wed, 15 Jan 2020 10:53:15 +0000 |
| parents | b3ab85121e4d |
| children | b67327177159 |
line wrap: on
line diff
--- a/Discovery/Src/base.c Wed Jan 08 15:35:15 2020 +0100 +++ b/Discovery/Src/base.c Wed Jan 15 10:53:15 2020 +0000 @@ -351,6 +351,7 @@ uint8_t lastsecond = 0xFF; #endif + SStateList status; detectionState_t pitchstate; set_globalState( StBoot0 ); LastButtonPressed = 0; @@ -477,6 +478,16 @@ updateMenu(); ext_flash_write_settings(); } + + /* check if tasks depending on global state are pending */ + get_globalStateList(&status); + if(status.base == BaseHome) + { + tMenuEdit_writeSettingsToFlash(); // takes 900 ms!! + } + + DataEX_merge_devicedata(); /* data is exchanged at startup and every 10 minutes => check if something changed */ + deco_loop(); TriggerButtonAction(); if(DoDisplayRefresh) /* set every 100ms by timer interrupt */ @@ -624,8 +635,6 @@ base_tempLightLevel = TIM_BACKLIGHT_adjust(); tCCR_tick(); tHome_tick(); - if(status.base == BaseHome) - tMenuEdit_writeSettingsToFlash(); // takes 900 ms!! break; case BaseStop: DateEx_copy_to_dataOut(); @@ -1671,7 +1680,7 @@ static CALC_WHAT what = CALC_INVALID; static int counter = 0; - if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (decoLock != DECO_CALC_ready )) + if((stateUsed->mode != MODE_DIVE) || (stateUsed->diveSettings.diveMode == DIVEMODE_Apnea) || (stateUsed->diveSettings.diveMode == DIVEMODE_Gauge) || (decoLock != DECO_CALC_ready )) return; decoLock = DECO_CALC_running;
