Moving test inside timer condition

This commit is contained in:
Stephan Hadinger 2020-04-07 14:21:17 +02:00
parent 7a6628d903
commit 6219c0fee2

View File

@ -748,11 +748,11 @@ void wifiKeepAlive(void) {
if ((WL_CONNECTED != Wifi.status) || (0 == wifiTimerSec)) { return; } // quick exit if wifi not connected or feature disabled
if (wifiTimerSec > 100) {
wifiTimerSec = (wifiTimerSec - 100) * 60; // convert >100 as minutes, ex: 105 = 5 minutes, 110 = 10 minutes
}
if (TimeReached(wifiTimer)) {
stationKeepAliveNow();
if (wifiTimerSec > 100) {
wifiTimerSec = (wifiTimerSec - 100) * 60; // convert >100 as minutes, ex: 105 = 5 minutes, 110 = 10 minutes
}
SetNextTimeInterval(wifiTimer, wifiTimerSec * 1000);
}
}