Files
IoTManager/src/Clock.cpp

17 lines
408 B
C++
Raw Normal View History

2020-10-20 23:58:23 +03:00
#include "Clock.h"
#include "Global.h"
Clock* timeNow;
2020-12-10 19:12:15 +03:00
void clockInit() {
2020-10-20 23:58:23 +03:00
timeNow = new Clock;
timeNow->setNtpPool(jsonReadStr(configSetupJson, "ntp"));
timeNow->setTimezone(jsonReadStr(configSetupJson, "timezone").toInt());
ts.add(
TIME_SYNC, 30000, [&](void*) {
timeNow->hasSync();
},
nullptr, true);
2020-12-15 22:10:40 +01:00
SerialPrint("I", F("NTP"), F("Clock Init"));
2020-10-20 23:58:23 +03:00
}