From b17ffccac8fa1eaf567ab5d3b260eac70b030728 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 13 Nov 2019 09:38:56 +0100 Subject: [PATCH] Screenshots on X10 / X12S were not always working (thanks Lothar for the report) --- radio/src/main.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/radio/src/main.cpp b/radio/src/main.cpp index 785c5e423..6a79958de 100644 --- a/radio/src/main.cpp +++ b/radio/src/main.cpp @@ -358,6 +358,11 @@ void guiMain(event_t evt) DEBUG_TIMER_STOP(debugTimerMenus); } + if (mainRequestFlags & (1u << REQUEST_SCREENSHOT)) { + writeScreenshot(); + mainRequestFlags &= ~(1u << REQUEST_SCREENSHOT); + } + if (refreshNeeded) { DEBUG_TIMER_START(debugTimerLcdRefresh); lcdRefresh(); @@ -365,7 +370,6 @@ void guiMain(event_t evt) } } #elif defined(GUI) - void handleGui(event_t event) { // if Lua standalone, run it and don't clear the screen (Lua will do it) // else if Lua telemetry view, run it and don't clear the screen @@ -463,6 +467,11 @@ void guiMain(event_t evt) } lcdRefresh(); + + if (mainRequestFlags & (1 << REQUEST_SCREENSHOT)) { + writeScreenshot(); + mainRequestFlags &= ~(1 << REQUEST_SCREENSHOT); + } } #endif @@ -531,11 +540,6 @@ void perMain() DEBUG_TIMER_STOP(debugTimerGuiMain); #endif - if (mainRequestFlags & (1 << REQUEST_SCREENSHOT)) { - writeScreenshot(); - mainRequestFlags &= ~(1 << REQUEST_SCREENSHOT); - } - #if defined(PCBX9E) && !defined(SIMU) toplcdRefreshStart(); setTopFirstTimer(getValue(MIXSRC_FIRST_TIMER+g_model.toplcdTimer)); -- 2.11.4.GIT