Allow deepsleep to wait for second TELEPERIOD intervall

Compatible with old values  teleperiod10 or 300 to start deepsleep immediately asap.
All Other values (at least >15, because this is often min runtime) for teleperiod causes the device to wait for another teleperiod
eventually fix for #7295
This commit is contained in:
stefanbode 2019-12-22 19:59:56 +01:00 committed by GitHub
parent 7695a2c5bf
commit 3fee364fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ bool Xdrv29(uint8_t function)
DeepSleepEverySecond();
break;
case FUNC_AFTER_TELEPERIOD:
if (DeepSleepEnabled() && !deepsleep_flag) {
if (DeepSleepEnabled() && !deepsleep_flag && (Settings.tele_period == 10 || Settings.tele_period == 300 || UpTime() > Settings.tele_period)) {
deepsleep_flag = DEEPSLEEP_START_COUNTDOWN; // Start deepsleep in 4 seconds
}
break;