mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-08 05:31:38 +02:00
Merge branch 'development03' into hms
This commit is contained in:
commit
3d82e127f8
12 changed files with 40 additions and 16 deletions
|
@ -229,7 +229,8 @@ void app::tickNtpUpdate(void) {
|
|||
if(mConfig->inst.rstValsNotAvail)
|
||||
everyMin(std::bind(&app::tickMinute, this), "tMin");
|
||||
if(mConfig->inst.rstYieldMidNight) {
|
||||
uint32_t midTrig = mTimestamp - ((mTimestamp - 1) % 86400) + 86400; // next midnight
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t midTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi");
|
||||
}
|
||||
}
|
||||
|
@ -340,7 +341,8 @@ void app::tickMinute(void) {
|
|||
//-----------------------------------------------------------------------------
|
||||
void app::tickMidnight(void) {
|
||||
// only triggered if 'reset values at midnight is enabled'
|
||||
uint32_t nxtTrig = mTimestamp - ((mTimestamp - 1) % 86400) + 86400; // next midnight
|
||||
uint32_t localTime = gTimezone.toLocal(mTimestamp);
|
||||
uint32_t nxtTrig = gTimezone.toUTC(localTime - (localTime % 86400) + 86400); // next midnight local time
|
||||
onceAt(std::bind(&app::tickMidnight, this), nxtTrig, "mid2");
|
||||
|
||||
Inverter<> *iv;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue