mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 03:00:56 +00:00
Merge branch 'master' into esp32-c6
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user