|
@ -193,7 +193,7 @@ void app::tickNtpUpdate(void) { |
|
|
if(mConfig->inst.rstValsNotAvail) |
|
|
if(mConfig->inst.rstValsNotAvail) |
|
|
everyMin(std::bind(&app::tickMinute, this), "tMin"); |
|
|
everyMin(std::bind(&app::tickMinute, this), "tMin"); |
|
|
if(mConfig->inst.rstYieldMidNight) { |
|
|
if(mConfig->inst.rstYieldMidNight) { |
|
|
uint32_t midTrig = mTimestamp - ((mTimestamp - 1) % 86400) + 86400; // next midnight
|
|
|
uint32_t midTrig = mTimestamp - ((mTimestamp + MIDNIGHTTICKER_OFFSET) % 86400) + 86400; // next midnight
|
|
|
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi"); |
|
|
onceAt(std::bind(&app::tickMidnight, this), midTrig, "midNi"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -304,7 +304,7 @@ void app::tickMinute(void) { |
|
|
//-----------------------------------------------------------------------------
|
|
|
//-----------------------------------------------------------------------------
|
|
|
void app::tickMidnight(void) { |
|
|
void app::tickMidnight(void) { |
|
|
// only triggered if 'reset values at midnight is enabled'
|
|
|
// only triggered if 'reset values at midnight is enabled'
|
|
|
uint32_t nxtTrig = mTimestamp - ((mTimestamp - 1) % 86400) + 86400; // next midnight
|
|
|
uint32_t nxtTrig = mTimestamp - ((mTimestamp + MIDNIGHTTICKER_OFFSET) % 86400) + 86400; // next midnight
|
|
|
onceAt(std::bind(&app::tickMidnight, this), nxtTrig, "mid2"); |
|
|
onceAt(std::bind(&app::tickMidnight, this), nxtTrig, "mid2"); |
|
|
|
|
|
|
|
|
Inverter<> *iv; |
|
|
Inverter<> *iv; |
|
|