mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-02 14:22:55 +03:00
Remove duplication and incompatible declarations in sntp.h (#6610)
This removes definitions relating to the built-in SNTP client that are LwIP v1 specific. Instead of duplicating these pull in the LwIP header that correspond to the required functions depending on the version of the stack being used. Without this fix calls to sntp_getserver() work but return invalid data and can lead to stack exhaustion. Update the NTP-TZ-DST example to use the Arduino sntp.h header rather than duplicate the conditional checks to use the LwIP header. Tests: - Build against a simple SNTP API demonstratin app and all LwIP configurations. Verify that the app runs for an extended period and that the expected results are obtained.
This commit is contained in:
committed by
Earle F. Philhower, III
parent
c55f49bd61
commit
d7abafea2f
@ -51,11 +51,7 @@
|
||||
#include <time.h> // time() ctime()
|
||||
#include <sys/time.h> // struct timeval
|
||||
|
||||
#if LWIP_VERSION_MAJOR == 1
|
||||
#include <lwip/sntp.h> // sntp_servermode_dhcp()
|
||||
#else
|
||||
#include <lwip/apps/sntp.h> // sntp_servermode_dhcp()
|
||||
#endif
|
||||
#include <sntp.h> // sntp_servermode_dhcp()
|
||||
|
||||
// for testing purpose:
|
||||
extern "C" int clock_gettime(clockid_t unused, struct timespec *tp);
|
||||
|
Reference in New Issue
Block a user