diff --git a/radio/src/gui/Taranis/lcd.h b/radio/src/gui/Taranis/lcd.h index caecc1ded..52a4c3ea6 100755 --- a/radio/src/gui/Taranis/lcd.h +++ b/radio/src/gui/Taranis/lcd.h @@ -213,6 +213,8 @@ void lcd_invert_line(int8_t line); #define lcd_status_line() lcd_invert_line(LCD_LINES-1) inline void lcd_square(coord_t x, coord_t y, coord_t w, LcdFlags att=0) { lcd_rect(x, y, w, w, SOLID, att); } +void displaySleepBitmap(); + void lcdDrawTelemetryTopBar(); #define V_BAR(xx, yy, ll) \ diff --git a/radio/src/gui/Taranis/widgets.cpp b/radio/src/gui/Taranis/widgets.cpp index f189b6f2f..02726e862 100755 --- a/radio/src/gui/Taranis/widgets.cpp +++ b/radio/src/gui/Taranis/widgets.cpp @@ -36,6 +36,17 @@ #include "../../opentx.h" +const pm_uchar bmp_sleep[] PROGMEM = { + #include "../../bitmaps/Taranis/sleep.lbm" +}; + +void displaySleepBitmap() +{ + lcd_clear(); + lcd_bmp(76, 2, bmp_sleep, 0, 60); + lcdRefresh(); +} + void drawStick(coord_t centrex, int16_t xval, int16_t yval) { #define BOX_CENTERY (LCD_H-BOX_WIDTH/2-10) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 67e6d501f..52e509be2 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1902,9 +1902,11 @@ void opentxClose() } #endif +#if !defined(PCBTARANIS) if (s_eeDirtyMsk & EE_MODEL) { displayPopup(STR_SAVEMODEL); } +#endif g_eeGeneral.unexpectedShutdown = 0; diff --git a/radio/src/targets/taranis/board_taranis.cpp b/radio/src/targets/taranis/board_taranis.cpp index 518e466ee..c24c633b6 100644 --- a/radio/src/targets/taranis/board_taranis.cpp +++ b/radio/src/targets/taranis/board_taranis.cpp @@ -123,10 +123,6 @@ extern "C" void INTERRUPT_5MS_IRQHandler() const pm_uchar bmp_lock[] PROGMEM = { #include "../../bitmaps/Taranis/lock.lbm" }; - - const pm_uchar bmp_sleep[] PROGMEM = { - #include "../../bitmaps/Taranis/sleep.lbm" - }; #endif void boardInit() @@ -177,8 +173,7 @@ void boardInit() lcd_bmp(76, 2, bmp_startup, index*60, 60); } else if (duration >= PWR_PRESS_DURATION_MAX) { - lcd_clear(); - lcd_bmp(76, 2, bmp_sleep, 0, 60); + displaySleepBitmap(); turnBacklightOff(); } else { diff --git a/radio/src/tasks_arm.cpp b/radio/src/tasks_arm.cpp index 2f2d8e4dc..8d3762411 100644 --- a/radio/src/tasks_arm.cpp +++ b/radio/src/tasks_arm.cpp @@ -182,19 +182,21 @@ void menusTask(void * pdata) } } - lcd_clear(); - displayPopup(STR_SHUTDOWN); - - opentxClose(); - - lcd_clear(); - lcdRefresh(); - lcdOff(); - BACKLIGHT_OFF(); #if defined(REV9E) topLcdOff(); #endif + BACKLIGHT_OFF(); + +#if defined(PCBTARANIS) + displaySleepBitmap(); +#else + lcd_clear(); + displayPopup(STR_SHUTDOWN); +#endif + + opentxClose(); + #if !defined(SIMU) SysTick->CTRL = 0; // turn off systick #endif