From 05a55c728b8d4b5ab39f385ea1edde79e2d20137 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 3 Sep 2012 23:26:05 +0000 Subject: [PATCH] Issue 96 fixed --- src/main_views.cpp | 4 ++++ src/open9x.cpp | 7 ++++++- src/open9x.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main_views.cpp b/src/main_views.cpp index 0f98f50a7..5921abdbe 100644 --- a/src/main_views.cpp +++ b/src/main_views.cpp @@ -205,6 +205,10 @@ void menuMainView(uint8_t event) putsVBat(6*FW-1, 2*FH, att|NO_UNIT); lcd_putc(6*FW, 3*FH, 'V'); + if (unexpectedShutdown) { + lcd_putcAtt(20*FW-3, 0*FH, '!', INVERS); + } + if (g_model.timers[0].mode) { uint8_t att = DBLSIZE | (s_timerState[0]==TMR_BEEPING ? BLINK|INVERS : 0); putsTime(12*FW+3, FH*2, s_timerVal[0], att, att); diff --git a/src/open9x.cpp b/src/open9x.cpp index f8c4ce9f7..805b91d68 100644 --- a/src/open9x.cpp +++ b/src/open9x.cpp @@ -83,6 +83,8 @@ uint8_t g_tmr1Latency_max; uint8_t g_tmr1Latency_min; #endif +uint8_t unexpectedShutdown = 0; + uint16_t g_timeMainMax; #if defined(PCBV4) uint8_t g_timeMainLast; @@ -3161,7 +3163,10 @@ inline void open9xInit(OPEN9X_INIT_ARGS) if (g_eeGeneral.backlightMode != e_backlight_mode_off) backlightOn(); // on Tx start turn the light on - if (!UNEXPECTED_SHUTDOWN()) { + if (UNEXPECTED_SHUTDOWN()) { + unexpectedShutdown = 1; + } + else { doSplash(); #if defined(PCBARM) && defined(SDCARD) diff --git a/src/open9x.h b/src/open9x.h index 6819e9d0a..0547d13e6 100644 --- a/src/open9x.h +++ b/src/open9x.h @@ -614,6 +614,7 @@ extern uint8_t trimsCheckTimer; void resetTimer(uint8_t idx); void resetAll(); +extern uint8_t unexpectedShutdown; extern uint8_t g_tmr1Latency_max; extern uint8_t g_tmr1Latency_min; extern uint16_t g_timeMainMax;