Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 740fc0b

Browse files
Merge pull request #10725 from mathieucarbou/issue-10526
fix(sntp): Lock / Unlock LWIP if CONFIG_LWIP_TCPIP_CORE_LOCKING is set
2 parents fb6e977 + 71396de commit 740fc0b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎cores/esp32/esp32-hal-time.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,17 @@ static void setTimeZone(long offset, int daylight) {
5151
void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1, const char *server2, const char *server3) {
5252
//tcpip_adapter_init(); // Should not hurt anything if already inited
5353
esp_netif_init();
54-
if (sntp_enabled()) {
55-
sntp_stop();
56-
}
5754

5855
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
5956
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
6057
LOCK_TCPIP_CORE();
6158
}
6259
#endif
6360

61+
if (sntp_enabled()) {
62+
sntp_stop();
63+
}
64+
6465
sntp_setoperatingmode(SNTP_OPMODE_POLL);
6566
sntp_setservername(0, (char *)server1);
6667
sntp_setservername(1, (char *)server2);
@@ -83,16 +84,17 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char *server1,
8384
void configTzTime(const char *tz, const char *server1, const char *server2, const char *server3) {
8485
//tcpip_adapter_init(); // Should not hurt anything if already inited
8586
esp_netif_init();
86-
if (sntp_enabled()) {
87-
sntp_stop();
88-
}
8987

9088
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
9189
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) {
9290
LOCK_TCPIP_CORE();
9391
}
9492
#endif
9593

94+
if (sntp_enabled()) {
95+
sntp_stop();
96+
}
97+
9698
sntp_setoperatingmode(SNTP_OPMODE_POLL);
9799
sntp_setservername(0, (char *)server1);
98100
sntp_setservername(1, (char *)server2);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /