From 2b32abe4677023245b955436762e62d802c91968 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 13 Sep 2016 18:35:03 +0200 Subject: [PATCH] [ARM boards] Model persistent timers / telemetry / pots positions were not always correctly saved --- radio/src/gui/128x64/gui.h | 5 ++++- radio/src/gui/128x64/popups.cpp | 4 ++-- radio/src/opentx.cpp | 31 +++++----------------------- radio/src/storage/eeprom_common.cpp | 2 +- radio/src/storage/storage.h | 1 + radio/src/storage/storage_common.cpp | 26 +++++++++++++++++++++++ radio/src/tasks_arm.cpp | 6 ------ radio/src/timers.cpp | 10 +-------- 8 files changed, 40 insertions(+), 45 deletions(-) diff --git a/radio/src/gui/128x64/gui.h b/radio/src/gui/128x64/gui.h index 9be1b9ff0..cdee4a6cb 100644 --- a/radio/src/gui/128x64/gui.h +++ b/radio/src/gui/128x64/gui.h @@ -425,13 +425,16 @@ inline void drawProgressBar(const char * label) { // TODO } + inline void updateProgressBar(int num, int den) { // TODO } + inline void drawSleepBitmap() { - // TODO + lcdClear(); + showMessageBox(STR_SHUTDOWN); } #if !defined(CPUM64) diff --git a/radio/src/gui/128x64/popups.cpp b/radio/src/gui/128x64/popups.cpp index a7e2e939e..a9e6e8a8d 100644 --- a/radio/src/gui/128x64/popups.cpp +++ b/radio/src/gui/128x64/popups.cpp @@ -45,9 +45,9 @@ void drawMessageBox() // could be a place for a warningInfoText } -void showMessageBox(const pm_char * pstr) +void showMessageBox(const pm_char * str) { - warningText = pstr; + warningText = str; drawMessageBox(); warningText = NULL; lcdRefresh(); diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index c9c7d9073..4aa9187cf 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1882,15 +1882,12 @@ void opentxClose(uint8_t shutdown) logsClose(); #endif - saveTimers(); + storageFlushCurrentModel(); -#if defined(CPUARM) - for (int i=0; i 0) { + g_eeGeneral.globalTimer += sessionTimer; + sessionTimer = 0; } #endif @@ -1901,25 +1898,7 @@ void opentxClose(uint8_t shutdown) } #endif -#if defined(PCBTARANIS) - if (g_model.potsWarnMode == POTS_WARN_AUTO) { - for (int i=0; i 0) { - g_eeGeneral.globalTimer += sessionTimer; - storageDirty(EE_GENERAL); - sessionTimer = 0; - } -#endif } -#endif // #if defined(CPUARM) || defined(CPUM2560) +#endif // #if defined(CPUARM) || defined(CPUM2560) #if defined(ACCURAT_THROTTLE_TIMER) #define THR_TRG_TRESHOLD 13 // approximately 10% full throttle