* refactored UITask from repeater/room/sensor to /helpers/ui/server
* added BaseUITask for common behaviours * ui_task now instantiated in one of the variant's target-*.cpp modules
This commit is contained in:
1 parent
ca5804616e
commit
0e164ae46c
20 files changed
+117
-363
No files matched your search
@@ -0,0 +1,17 @@
|
||||
#include "BaseUITask.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
void BaseUITask::loop() {
|
||||
if (_display->isOn()) {
|
||||
if (millis() >= _next_refresh) {
|
||||
_display->startFrame();
|
||||
long interval = renderCurrScreen();
|
||||
_display->endFrame();
|
||||
|
||||
_next_refresh = millis() + interval;
|
||||
}
|
||||
if (millis() > _auto_off) {
|
||||
_display->turnOff();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user