From 6c615cabb10a7f25733d27203b1adec48a712429 Mon Sep 17 00:00:00 2001 From: stefanbode Date: Tue, 10 May 2022 08:59:18 +0200 Subject: [PATCH] Fix error on wrong wakeup calculation due to a buffer overflow it could be that on a "reset" wakeup the next interval was skipped. --- tasmota/xdrv_29_deepsleep.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_29_deepsleep.ino b/tasmota/xdrv_29_deepsleep.ino index 3529ccd42..81f7b3a3e 100644 --- a/tasmota/xdrv_29_deepsleep.ino +++ b/tasmota/xdrv_29_deepsleep.ino @@ -106,7 +106,7 @@ void DeepSleepPrepare(void) // Timeslip in 0.1 seconds between the real wakeup and the calculated wakeup // Because deepsleep is in second and timeslip in 0.1 sec the compare always check if the slip is in the 10% range - int16_t timeslip = (int16_t)(RtcSettings.nextwakeup + millis() / 1000 - LocalTime()) * 10; + int32_t timeslip = (int32_t)(RtcSettings.nextwakeup + millis() / 1000 - LocalTime()) * 10; // Allow 10% of deepsleep error to count as valid deepsleep; expecting 3-4% // if more then 10% timeslip = 0 == non valid wakeup; maybe manual