From 0d1761d7ad70972a423a1a2fa0ecfa2d162f4a5c Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 14 Nov 2019 11:53:46 +0100 Subject: [PATCH] Screenshots on X10 / X12S were not always working (thanks Lothar for the new report) --- radio/src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radio/src/main.cpp b/radio/src/main.cpp index 6a79958de..58355b2eb 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -289,13 +289,14 @@ void guiMain(event_t evt) lcdRefreshWait(); // WARNING: make sure no code above this line does any change to the LCD display buffer! #endif + bool screenshotRequested = (mainRequestFlags & (1u << REQUEST_SCREENSHOT)); + if (!refreshNeeded) { DEBUG_TIMER_START(debugTimerMenus); while (true) { // normal GUI from menus const char * warn = warningText; uint8_t menu = popupMenuItemsCount; - static bool popupDisplayed = false; if (warn || menu) { if (popupDisplayed == false) { @@ -305,7 +306,7 @@ void guiMain(event_t evt) lcdStoreBackupBuffer(); TIME_MEASURE_STOP(storebackup); } - if (popupDisplayed == false || evt) { + if (popupDisplayed == false || evt || screenshotRequested) { popupDisplayed = lcdRestoreBackupBuffer(); if (warn) { DISPLAY_WARNING(evt); @@ -358,7 +359,7 @@ void guiMain(event_t evt) DEBUG_TIMER_STOP(debugTimerMenus); } - if (mainRequestFlags & (1u << REQUEST_SCREENSHOT)) { + if (screenshotRequested) { writeScreenshot(); mainRequestFlags &= ~(1u << REQUEST_SCREENSHOT); }