From 894ced16efd9c1a3ae05312d856e6be11d2e0f98 Mon Sep 17 00:00:00 2001 From: Jasper Date: Sun, 13 Mar 2022 19:54:54 +0100 Subject: [PATCH] Redraw screen after alarms/changing encoders --- lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp index 85a827a..8f2e325 100644 --- a/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp +++ b/lib/FT18_STW_DISPLAY/FT18_STW_DISPLAY.cpp @@ -173,7 +173,12 @@ bool check_display(uint8_t& val_old, uint8_t val_new, bool& active, uint32_t& be } void update_display(){ + static DisplayPage page = PAGE_DRIVER; + static uint32_t last_cleared; + static bool cleared = true; + if (check_alarms()) { + cleared = true; return; } if (tft.disconnected) { @@ -181,12 +186,10 @@ void update_display(){ } if (check_enc_displays()) { + cleared = true; return; } - static DisplayPage page = PAGE_DRIVER; - static uint32_t last_cleared; - static bool cleared = true; uint32_t now = millis(); if(Stw_data.button1_rises > 0){ Stw_data.button1_rises--;