diff --git a/include/display.h b/include/display.h index 89817ec..990dd18 100644 --- a/include/display.h +++ b/include/display.h @@ -14,6 +14,7 @@ #define BRIGHTNESS_NIGHT BRIGHTNESS_MIN #define BRIGHTNESS_DAY 11 #define SECONDS(value) value*1000 +#define DISPLAY_SENSOR_ITERATIONS 2 namespace Display { @@ -28,10 +29,11 @@ namespace Display { }, []() { drawColon(false); }); - Task tDisplaySensor(5*TASK_SECOND, 4, displayTemp, &ts, false, []() { + Task tDisplaySensor(5*TASK_SECOND, DISPLAY_SENSOR_ITERATIONS, displayTemp, &ts, false, []() { tDisplayTime.disable(); return true; }, []() { + tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS); tDisplayTime.enableDelayed(tDisplaySensor.getInterval()); }); diff --git a/src/esp_clock.cpp b/src/esp_clock.cpp index 74f938f..1fe602b 100644 --- a/src/esp_clock.cpp +++ b/src/esp_clock.cpp @@ -37,6 +37,7 @@ Task tReadBme(TASK_MINUTE, TASK_FOREVER, []() { Mqtt::publishBme280(); if (abs(lastTemp - Bme::data.temp) > 0.2) { lastTemp = Bme::data.temp; + Display::tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS*2); Display::tDisplaySensor.restart(); } }, &ts);