From dddc50c1cddc3f3134f5cd4c839d32d8d8c5bb5f Mon Sep 17 00:00:00 2001 From: Larry Bernstone Date: Sun, 10 Nov 2019 09:14:09 -0700 Subject: [PATCH] Fixed so configTime will not crash if tcpip is not initialized --- cores/esp32/esp32-hal-time.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c index e64c764b478..5647f1f50dc 100644 --- a/cores/esp32/esp32-hal-time.c +++ b/cores/esp32/esp32-hal-time.c @@ -14,6 +14,7 @@ #include "esp32-hal.h" #include "lwip/apps/sntp.h" +#include "tcpip_adapter.h" static void setTimeZone(long offset, int daylight) { @@ -45,6 +46,7 @@ static void setTimeZone(long offset, int daylight) * */ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) { + tcpip_adapter_init(); // Should not hurt anything if already inited if(sntp_enabled()){ sntp_stop(); } @@ -62,6 +64,7 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, * */ void configTzTime(const char* tz, const char* server1, const char* server2, const char* server3) { + tcpip_adapter_init(); // Should not hurt anything if already inited if(sntp_enabled()){ sntp_stop(); }