1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

Removed sessionTimer and replaced with existing s_timeCumTot.

Corrected bug when saving g_eeGeneral.globalTimer (missing reset of session timer and eeprom dirty)
This commit is contained in:
Damjan Adamic 2014-07-03 19:14:15 +02:00
parent 1fef79ce80
commit b6cbde48be
2 changed files with 10 additions and 16 deletions

View file

@ -1385,10 +1385,6 @@ uint32_t Current_accumulator;
uint32_t Current_used;
#endif
#if defined(CPUARM) && !defined(REVA)
uint16_t sessionTimer;
#endif
#if !defined(SIMU)
static uint16_t s_anaFilt[NUMBER_ANALOG];
#endif
@ -2653,16 +2649,11 @@ void perMain()
static uint32_t OneSecTimer;
if (++OneSecTimer >= 100) {
OneSecTimer -= 100 ;
sessionTimer += 1;
Current_used += Current_accumulator / 100 ; // milliAmpSeconds (but scaled)
Current_accumulator = 0 ;
}
#endif
#if defined(PCBTARANIS)
sessionTimer = s_timeCumTot;
#endif
#if defined(CPUARM)
if (currentSpeakerVolume != requiredSpeakerVolume) {
currentSpeakerVolume = requiredSpeakerVolume;
@ -3247,8 +3238,10 @@ void saveTimers()
}
#if defined(CPUARM) && !defined(REVA)
if (sessionTimer > 0) {
g_eeGeneral.globalTimer += sessionTimer;
if (s_timeCumTot > 0) {
g_eeGeneral.globalTimer += s_timeCumTot;
eeDirty(EE_GENERAL);
s_timeCumTot = 0;
}
#endif
}