mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
time works
This commit is contained in:
16
src/main.cpp
16
src/main.cpp
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "HttpServer.h"
|
||||
#include "Bus/BusScanner.h"
|
||||
#include "Utils/Timings.h"
|
||||
|
||||
void not_async_actions();
|
||||
|
||||
@@ -84,22 +85,27 @@ void saveConfig() {
|
||||
writeFile(String("config.json"), configSetupJson);
|
||||
}
|
||||
|
||||
Timings metric;
|
||||
|
||||
void loop() {
|
||||
#ifdef OTA_UPDATES_ENABLED
|
||||
ArduinoOTA.handle();
|
||||
#endif
|
||||
|
||||
#ifdef WS_enable
|
||||
ws.cleanupClients();
|
||||
#endif
|
||||
|
||||
metric.add(MT_ONE);
|
||||
not_async_actions();
|
||||
|
||||
metric.add(MT_TWO);
|
||||
MqttClient::loop();
|
||||
|
||||
loopCmd();
|
||||
|
||||
loopButton();
|
||||
|
||||
loopScenario();
|
||||
|
||||
#ifdef UDP_ENABLED
|
||||
loopUdp();
|
||||
#endif
|
||||
@@ -107,6 +113,12 @@ void loop() {
|
||||
loopSerial();
|
||||
|
||||
ts.update();
|
||||
|
||||
if (metric._counter > 100000) {
|
||||
metric.print();
|
||||
} else {
|
||||
metric.count();
|
||||
}
|
||||
}
|
||||
|
||||
void not_async_actions() {
|
||||
|
||||
Reference in New Issue
Block a user