Skip to content

Commit

Permalink
fixed refreshScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Feb 11, 2021
1 parent a3237a6 commit dd53e38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/eez/gui/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]);
Expand All @@ -57,4 +63,4 @@ void updateScreen() {
} // namespace gui
} // namespace eez

#endif
#endif

0 comments on commit dd53e38

Please sign in to comment.