From dd53e38e0f001627a8782c535a8d32cb56f01e5a Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Thu, 11 Feb 2021 18:18:01 +0100 Subject: [PATCH] fixed refreshScreen --- src/eez/gui/update.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/eez/gui/update.cpp b/src/eez/gui/update.cpp index 817271355..ffb094ddd 100644 --- a/src/eez/gui/update.cpp +++ b/src/eez/gui/update.cpp @@ -28,6 +28,7 @@ namespace gui { static uint8_t g_stateBuffer[2][CONF_MAX_STATE_SIZE]; static WidgetState *g_previousState; static WidgetState *g_currentState; +static bool g_refreshScreen; int getCurrentStateBufferIndex() { return (uint8_t *)g_currentState == &g_stateBuffer[0][0] ? 0 : 1; @@ -38,10 +39,15 @@ uint32_t getCurrentStateBufferSize(const WidgetCursor &widgetCursor) { } void refreshScreen() { - g_currentState = 0; + g_refreshScreen = true; } void updateScreen() { + if (g_refreshScreen) { + g_refreshScreen = false; + g_currentState = 0; + } + g_isActiveWidget = false; g_previousState = g_currentState; g_currentState = (WidgetState *)(&g_stateBuffer[getCurrentStateBufferIndex() == 0 ? 1 : 0][0]); @@ -57,4 +63,4 @@ void updateScreen() { } // namespace gui } // namespace eez -#endif \ No newline at end of file +#endif