[Taranis] Add cumulative usage timer in Statistics view, reset with MENU LONG

This commit is contained in:
Andre Bernet
2013-11-30 11:40:59 +01:00
parent aee3a1c25e
commit 0c0f559f75
2 changed files with 13 additions and 2 deletions
+9 -2
View File
@@ -46,7 +46,11 @@ void menuStatisticsView(uint8_t event)
case EVT_KEY_FIRST(KEY_UP): case EVT_KEY_FIRST(KEY_UP):
chainMenu(menuStatisticsDebug); chainMenu(menuStatisticsDebug);
return; return;
case EVT_KEY_FIRST(KEY_DOWN): #endif
#if defined(PCBTARANIS)
case EVT_KEY_LONG(KEY_MENU):
g_eeGeneral.globalTimer = 0;
break;
#endif #endif
case EVT_KEY_FIRST(KEY_EXIT): case EVT_KEY_FIRST(KEY_EXIT):
chainMenu(menuMainView); chainMenu(menuMainView);
@@ -64,6 +68,10 @@ void menuStatisticsView(uint8_t event)
lcd_puts( 17*FW, FH*0, STR_TOT); lcd_puts( 17*FW, FH*0, STR_TOT);
putsTime( 12*FW+5*FWNUM+1, FH*0, s_timeCumTot, 0, 0); putsTime( 12*FW+5*FWNUM+1, FH*0, s_timeCumTot, 0, 0);
#if defined(PCBTARANIS)
putsTime(21*FW+5*FWNUM+1, 0*FH, g_eeGeneral.globalTimer + sessionTimer, 0, 0);
#endif
#if defined(THRTRACE) #if defined(THRTRACE)
uint8_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0); uint8_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
const uint8_t x=5; const uint8_t x=5;
@@ -119,7 +127,6 @@ void menuStatisticsDebug(uint8_t event)
case EVT_KEY_FIRST(KEY_DOWN): case EVT_KEY_FIRST(KEY_DOWN):
chainMenu(menuStatisticsView); chainMenu(menuStatisticsView);
return; return;
case EVT_KEY_FIRST(KEY_UP):
case EVT_KEY_FIRST(KEY_EXIT): case EVT_KEY_FIRST(KEY_EXIT):
chainMenu(menuMainView); chainMenu(menuMainView);
return; return;
+4
View File
@@ -4238,6 +4238,10 @@ void perMain()
} }
#endif #endif
#if defined(PCBTARANIS)
sessionTimer = s_timeCumTot;
#endif
#if defined(CPUARM) #if defined(CPUARM)
if (currentSpeakerVolume != requiredSpeakerVolume) { if (currentSpeakerVolume != requiredSpeakerVolume) {
currentSpeakerVolume = requiredSpeakerVolume; currentSpeakerVolume = requiredSpeakerVolume;