diff --git a/include/devices.h b/include/devices.h index 376fb21..8d37578 100644 --- a/include/devices.h +++ b/include/devices.h @@ -58,6 +58,7 @@ namespace Devices { [](const char* msg) { if (strcmp("PRESS", msg) == 0 && !Display::tDisplaySensor.isEnabled()) { Bme::data.readAll(); + Display::tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS); Display::tDisplaySensor.restart(); }; } diff --git a/include/display.h b/include/display.h index 049d34a..036d4c1 100644 --- a/include/display.h +++ b/include/display.h @@ -33,7 +33,7 @@ namespace Display { tDisplayTime.disable(); return true; }, []() { - tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS); + tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS*2); tDisplayTime.enableDelayed(tDisplaySensor.getInterval()); }); diff --git a/src/esp_clock.cpp b/src/esp_clock.cpp index 7b0ad8c..1927bb9 100644 --- a/src/esp_clock.cpp +++ b/src/esp_clock.cpp @@ -30,6 +30,7 @@ void turnLed(bool on = true) { Task tButton(TASK_IMMEDIATE, TASK_ONCE, []() { if (Display::tDisplaySensor.isEnabled()) return; Bme::data.readAll(); + Display::tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS); Display::tDisplaySensor.restart(); }, &ts); Task tLed(TASK_IMMEDIATE, TASK_ONCE, []() { @@ -44,7 +45,6 @@ Task tReadBme(TASK_MINUTE, TASK_FOREVER, []() { Devices::publishBme280(); if (abs(lastTemp - Bme::data.temp) > 0.2) { lastTemp = Bme::data.temp; - Display::tDisplaySensor.setIterations(DISPLAY_SENSOR_ITERATIONS*2); Display::tDisplaySensor.restart(); } }, &ts);