mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-26 04:37:14 +02:00
Merge branch 'dev4' of https://github.com/tastendruecker123/ahoy into tastendruecker123-dev4
default of scheduled reboot is now 'false'
This commit is contained in:
commit
81a7f09e3a
5 changed files with 19 additions and 0 deletions
|
@ -233,6 +233,14 @@ void app::tickNtpUpdate(void) {
|
|||
uint32_t midTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi");
|
||||
}
|
||||
if (mConfig->sys.schedReboot) {
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t rebootTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86410); // reboot 10 secs after midnght
|
||||
if (rebootTrig <= mTimestamp) { //necessary for times other than midnight to prevent reboot loop
|
||||
rebootTrig += 86400;
|
||||
}
|
||||
onceAt(std::bind(&app::tickReboot, this), rebootTrig, "midRe");
|
||||
}
|
||||
}
|
||||
|
||||
nxtTrig = isOK ? 43200 : 60; // depending on NTP update success check again in 12 h or in 1 min
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue