diff --git a/radio/src/functions.cpp b/radio/src/functions.cpp index 9e2450ef0..f9b2d39f2 100644 --- a/radio/src/functions.cpp +++ b/radio/src/functions.cpp @@ -552,7 +552,7 @@ void evalFunctions() #if defined(PCBTARANIS) case FUNC_SCREENSHOT: if (!(functionsContext.activeSwitches & switch_mask)) { - writeScreenshot(); + requestScreenshot = true; } break; #endif diff --git a/radio/src/main_arm.cpp b/radio/src/main_arm.cpp index 747160ab3..3d32039b1 100644 --- a/radio/src/main_arm.cpp +++ b/radio/src/main_arm.cpp @@ -36,8 +36,9 @@ #include "opentx.h" -static uint8_t currentSpeakerVolume = 255; +uint8_t currentSpeakerVolume = 255; uint8_t requiredSpeakerVolume = 255; +uint8_t requestScreenshot = false; void handleUsbConnection() { @@ -207,4 +208,11 @@ void perMain() bt_wakeup(); #endif +#if defined(PCBTARANIS) + if (requestScreenshot) { + requestScreenshot = false; + writeScreenshot(); + } +#endif + } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index b8964aff9..8a7a14c2a 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1474,6 +1474,10 @@ enum AUDIO_SOUNDS { extern uint8_t requiredSpeakerVolume; #endif +#if defined(PCBTARANIS) +extern uint8_t requestScreenshot; +#endif + extern void checkBattery(); extern void opentxClose(); extern void opentxInit();