Skip to content

Commit 82699bb

Browse files
committed
Extend NTP synch to all platforms
1 parent 2e48a0e commit 82699bb

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/utility/time/TimeService.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ unsigned long esp8266_getRTC();
8989
* CONSTANTS
9090
**************************************************************************************/
9191

92-
#ifdef ARDUINO_ARCH_ESP8266
93-
static unsigned long const AIOT_TIMESERVICE_ESP8266_NTP_SYNC_TIMEOUT_ms = 86400000;
94-
#endif
92+
/* Default NTP synch is scheduled each 24 hours from startup */
93+
static unsigned long const AIOT_TIMESERVICE_NTP_SYNC_TIMEOUT_ms = 86400000;
94+
9595
static time_t const EPOCH_AT_COMPILE_TIME = cvt_time(__DATE__);
9696
static time_t const EPOCH = 0;
9797

@@ -105,11 +105,7 @@ TimeService::TimeService()
105105
, _is_tz_configured(false)
106106
, _timezone_offset(0)
107107
, _timezone_dst_until(0)
108-
#ifdef ARDUINO_ARCH_ESP8266
109108
, _last_ntp_sync_tick(0)
110-
, _last_rtc_update_tick(0)
111-
, _rtc(0)
112-
#endif
113109
{
114110

115111
}

src/utility/time/TimeService.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ class TimeService
5252
bool _is_tz_configured;
5353
long _timezone_offset;
5454
unsigned long _timezone_dst_until;
55-
#ifdef ARDUINO_ARCH_ESP8266
5655
unsigned long _last_ntp_sync_tick;
57-
unsigned long _last_rtc_update_tick;
58-
unsigned long _rtc;
59-
#endif
6056

6157
unsigned long getRemoteTime();
6258
bool connected();

0 commit comments

Comments
 (0)