From e1f25ba6b86166603cf3e4d80f3f6ef89683af9d Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 30 Jul 2019 14:39:08 +0200 Subject: [PATCH] do a full display refresh every hour --- src/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 6b2155f..9ebb34a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,6 +71,7 @@ sensor_readings_t sensors_a4cf1211c3e4, sensors_246f28d1fa5c, sensors_246f28d1a0 SensorHistory history_pressure(30); uint32_t lastDisplayUpdate = 0; +uint32_t lastDisplayRefresh = 0; bool bme280_active = false; bool bme680_active = false; bool uv_active = false; @@ -574,10 +575,17 @@ void setup() */ void loop() { - /* Do an e-paper display refresh every 2 minutes */ + /* Do an e-paper display refresh every 1 minutes */ if (millis() - lastDisplayUpdate >= 1*60*1000) { lastDisplayUpdate = millis(); + /* Do a full refresh every hour */ + if (millis() - lastDisplayRefresh >= 60*60*1000) { + lastDisplayRefresh = millis(); + display.clearScreen(); + display.refresh(); + } + getSensorMeasurements(); displayValues(); printValues();