From 6059c06289cd4e4ac81c17c0c41de7132a360755 Mon Sep 17 00:00:00 2001 From: Coscolin Date: Fri, 3 May 2024 01:27:27 +0200 Subject: [PATCH] Redefine full refresh with clearScreen() for EINKBOARDGDEM0213B74 boards --- CO2_Gadget_EINK.h | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/CO2_Gadget_EINK.h b/CO2_Gadget_EINK.h index b9304555..ded83446 100644 --- a/CO2_Gadget_EINK.h +++ b/CO2_Gadget_EINK.h @@ -676,25 +676,20 @@ void displayShowValues(bool forceRedraw = false) { #endif } - display.firstPage(); - do { - if (forceRedraw) { - display.setFullWindow(); - display.fillScreen(GxEPD_WHITE); - } - forceRedraw = true; // force to print all values - // testRedrawValues(true); - showCO2(co2, elementPosition.co2X, elementPosition.co2Y, forceRedraw); - showTemperature(temp, elementPosition.tempXValue, elementPosition.tempYValue, forceRedraw); - showHumidity(hum, elementPosition.humidityXValue, elementPosition.humidityYValue, forceRedraw); - showBatteryIcon(elementPosition.batteryIconX, elementPosition.batteryIconY, true); - showWiFiIcon(elementPosition.wifiIconX, elementPosition.wifiIconY, forceRedraw); - showMQTTIcon(elementPosition.mqttIconX, elementPosition.mqttIconY, forceRedraw); - showBLEIcon(elementPosition.bleIconX, elementPosition.bleIconY, forceRedraw); - showEspNowIcon(elementPosition.espNowIconX, elementPosition.espNowIconY, forceRedraw); - // display.hibernate(); - - } while (display.nextPage()); + if (forceRedraw) { + display.fillScreen(GxEPD_WHITE); + display.clearScreen(GxEPD_WHITE); + } + showCO2(co2, elementPosition.co2X, elementPosition.co2Y, forceRedraw); + showTemperature(temp, elementPosition.tempXValue, elementPosition.tempYValue, forceRedraw); + showHumidity(hum, elementPosition.humidityXValue, elementPosition.humidityYValue, forceRedraw); + showBatteryIcon(elementPosition.batteryIconX, elementPosition.batteryIconY, true); + showWiFiIcon(elementPosition.wifiIconX, elementPosition.wifiIconY, forceRedraw); + showMQTTIcon(elementPosition.mqttIconX, elementPosition.mqttIconY, forceRedraw); + showBLEIcon(elementPosition.bleIconX, elementPosition.bleIconY, forceRedraw); + showEspNowIcon(elementPosition.espNowIconX, elementPosition.espNowIconY, forceRedraw); + + display.display(true); // Partial update #ifdef TIMEDEBUG uint32_t elapsed = timer.read();