Merge pull request #15578 from stefanbode/patch-2

Fix error on wrong wakeup calculation
This commit is contained in:
Theo Arends 2022-05-10 09:03:46 +02:00 committed by GitHub
commit e2a24f5bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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