From 0c0f559f757a897747b91e6f3c14e6e7a1d4ada4 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Sat, 30 Nov 2013 11:40:59 +0100 Subject: [PATCH] [Taranis] Add cumulative usage timer in Statistics view, reset with MENU LONG --- src/gui/view_statistics.cpp | 11 +++++++++-- src/opentx.cpp | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/view_statistics.cpp b/src/gui/view_statistics.cpp index be02ac464..b352b85da 100644 --- a/src/gui/view_statistics.cpp +++ b/src/gui/view_statistics.cpp @@ -46,7 +46,11 @@ void menuStatisticsView(uint8_t event) case EVT_KEY_FIRST(KEY_UP): chainMenu(menuStatisticsDebug); return; - case EVT_KEY_FIRST(KEY_DOWN): +#endif +#if defined(PCBTARANIS) + case EVT_KEY_LONG(KEY_MENU): + g_eeGeneral.globalTimer = 0; + break; #endif case EVT_KEY_FIRST(KEY_EXIT): chainMenu(menuMainView); @@ -63,6 +67,10 @@ void menuStatisticsView(uint8_t event) lcd_puts( 17*FW, FH*0, STR_TOT); 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) uint8_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0); @@ -119,7 +127,6 @@ void menuStatisticsDebug(uint8_t event) case EVT_KEY_FIRST(KEY_DOWN): chainMenu(menuStatisticsView); return; - case EVT_KEY_FIRST(KEY_UP): case EVT_KEY_FIRST(KEY_EXIT): chainMenu(menuMainView); return; diff --git a/src/opentx.cpp b/src/opentx.cpp index c556e3843..d1612ec1d 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -4238,6 +4238,10 @@ void perMain() } #endif +#if defined(PCBTARANIS) + sessionTimer = s_timeCumTot; +#endif + #if defined(CPUARM) if (currentSpeakerVolume != requiredSpeakerVolume) { currentSpeakerVolume = requiredSpeakerVolume;