Merge branch 'master' into esp32-c6

This commit is contained in:
Thomas Göttgens
2024-09-26 00:20:00 +02:00
committed by GitHub
134 changed files with 2895 additions and 1171 deletions

View File

@@ -23,6 +23,7 @@ static void WiFiEvent(WiFiEvent_t event);
#endif
#ifndef DISABLE_NTP
#include "Throttle.h"
#include <NTPClient.h>
#endif
@@ -142,7 +143,7 @@ static int32_t reconnectWiFi()
}
#ifndef DISABLE_NTP
if (WiFi.isConnected() && (((millis() - lastrun_ntp) > 43200000) || (lastrun_ntp == 0))) { // every 12 hours
if (WiFi.isConnected() && (!Throttle::isWithinTimespanMs(lastrun_ntp, 43200000) || (lastrun_ntp == 0))) { // every 12 hours
LOG_DEBUG("Updating NTP time from %s\n", config.network.ntp_server);
if (timeClient.update()) {
LOG_DEBUG("NTP Request Success - Setting RTCQualityNTP if needed\n");
@@ -421,4 +422,4 @@ uint8_t getWifiDisconnectReason()
{
return wifiDisconnectReason;
}
#endif
#endif