Merge pull request #14887 from stefanbode/patch-8

Bugfix wrong wakeup time
This commit is contained in:
Theo Arends 2022-02-17 12:14:15 +01:00 committed by GitHub
commit 0ac59b3aca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ void DeepSleepPrepare(void)
// It may happen that wakeup in just <5 seconds in future
// In this case also add deepsleep to nextwakeup
if (RtcSettings.nextwakeup <= (LocalTime() - DEEPSLEEP_MIN_TIME)) {
if (RtcSettings.nextwakeup <= (LocalTime() + DEEPSLEEP_MIN_TIME)) {
// ensure nextwakeup is at least in the future
RtcSettings.nextwakeup += (((LocalTime() + DEEPSLEEP_MIN_TIME - RtcSettings.nextwakeup) / Settings->deepsleep) + 1) * Settings->deepsleep;
}