Skip to content

Commit 01cfc54

Browse files
authored
Add missing sntp_init/sntp_stop (#7628)
1 parent 4aeb0f5 commit 01cfc54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cores/esp8266/time.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ int _gettimeofday_r(struct _reent* unused, struct timeval *tp, void *tzp)
127127

128128
void configTime(int timezone_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)
129129
{
130+
sntp_stop();
131+
130132
// There is no way to tell when DST starts or stop with this API
131133
// So DST is always integrated in TZ
132134
// The other API should be preferred
@@ -178,6 +180,8 @@ void configTime(int timezone_sec, int daylightOffset_sec, const char* server1, c
178180
setServer(0, server1);
179181
setServer(1, server2);
180182
setServer(2, server3);
183+
184+
sntp_init();
181185
}
182186

183187
void setTZ(const char* tz){

0 commit comments

Comments
 (0)