Skip to content

Commit

Permalink
Merge pull request #211 from Coscolin/development
Browse files Browse the repository at this point in the history
Refactor full refresh with clearScreen() for EINKBOARDGDEM0213B74 boards
  • Loading branch information
melkati authored May 4, 2024
2 parents e12ff00 + 6059c06 commit 097cd0d
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions CO2_Gadget_EINK.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 097cd0d

Please sign in to comment.