display sensor values only once on startup
This commit is contained in:
parent
8a955fa43a
commit
16647d1f88
@ -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();
|
||||
};
|
||||
}
|
||||
|
||||
@ -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());
|
||||
});
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user