@@ -51,16 +51,17 @@ static void setTimeZone(long offset, int daylight) {
51
51
void configTime (long gmtOffset_sec , int daylightOffset_sec , const char * server1 , const char * server2 , const char * server3 ) {
52
52
//tcpip_adapter_init(); // Should not hurt anything if already inited
53
53
esp_netif_init ();
54
- if (sntp_enabled ()) {
55
- sntp_stop ();
56
- }
57
54
58
55
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
59
56
if (!sys_thread_tcpip (LWIP_CORE_LOCK_QUERY_HOLDER )) {
60
57
LOCK_TCPIP_CORE ();
61
58
}
62
59
#endif
63
60
61
+ if (sntp_enabled ()) {
62
+ sntp_stop ();
63
+ }
64
+
64
65
sntp_setoperatingmode (SNTP_OPMODE_POLL );
65
66
sntp_setservername (0 , (char * )server1 );
66
67
sntp_setservername (1 , (char * )server2 );
@@ -83,16 +84,17 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1,
83
84
void configTzTime (const char * tz , const char * server1 , const char * server2 , const char * server3 ) {
84
85
//tcpip_adapter_init(); // Should not hurt anything if already inited
85
86
esp_netif_init ();
86
- if (sntp_enabled ()) {
87
- sntp_stop ();
88
- }
89
87
90
88
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
91
89
if (!sys_thread_tcpip (LWIP_CORE_LOCK_QUERY_HOLDER )) {
92
90
LOCK_TCPIP_CORE ();
93
91
}
94
92
#endif
95
93
94
+ if (sntp_enabled ()) {
95
+ sntp_stop ();
96
+ }
97
+
96
98
sntp_setoperatingmode (SNTP_OPMODE_POLL );
97
99
sntp_setservername (0 , (char * )server1 );
98
100
sntp_setservername (1 , (char * )server2 );
0 commit comments