Fix for NTP sync on millis() rollover.

AP mode delay on boot (#2242).
pull/2465/head^2
Blaž Kristan 2022-01-10 13:53:11 +01:00
rodzic aba4dc7c50
commit 04f5bdb843
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -193,6 +193,7 @@ void WLED::loop()
if (lastMqttReconnectAttempt > millis()) {
rolloverMillis++;
lastMqttReconnectAttempt = 0;
ntpLastSyncTime = 0;
strip.restartRuntime();
}
if (millis() - lastMqttReconnectAttempt > 30000) {
@ -683,8 +684,10 @@ void WLED::handleConnection()
if (now < 2000 && (!WLED_WIFI_CONFIGURED || apBehavior == AP_BEHAVIOR_ALWAYS))
return;
if (lastReconnectAttempt == 0)
if (lastReconnectAttempt == 0) {
initConnection();
return;
}
// reconnect WiFi to clear stale allocations if heap gets too low
if (now - heapTime > 5000) {