mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-06 15:15:15 +08:00
feat(lwip): Integrate sntp with newlib time
This commit is contained in:
@ -174,6 +174,11 @@ config LWIP_IP6_DEBUG
|
|||||||
depends on LWIP_DEBUG
|
depends on LWIP_DEBUG
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config LWIP_SNTP_DEBUG
|
||||||
|
bool "Enable debugging for SNTP."
|
||||||
|
depends on LWIP_DEBUG
|
||||||
|
default n
|
||||||
|
|
||||||
config LWIP_SO_REUSE
|
config LWIP_SO_REUSE
|
||||||
bool "Enable SO_REUSEADDR option"
|
bool "Enable SO_REUSEADDR option"
|
||||||
default n
|
default n
|
||||||
|
@ -86,4 +86,6 @@ typedef int sys_prot_t;
|
|||||||
#define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff)))
|
#define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff)))
|
||||||
#define LWIP_PLATFORM_HTONL(_n) ((u32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) ))
|
#define LWIP_PLATFORM_HTONL(_n) ((u32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) ))
|
||||||
|
|
||||||
|
#define LWIP_TIMEVAL_PRIVATE 0
|
||||||
|
|
||||||
#endif /* __ARCH_CC_H__ */
|
#endif /* __ARCH_CC_H__ */
|
||||||
|
@ -711,11 +711,14 @@ extern void vPortFree(void *pv, const char * file, unsigned line);
|
|||||||
|
|
||||||
#define SNTP_SERVER_DNS 1
|
#define SNTP_SERVER_DNS 1
|
||||||
|
|
||||||
#ifndef sntp_time_t
|
#include <sys/time.h>
|
||||||
typedef long sntp_time_t;
|
|
||||||
#endif
|
#define SNTP_SET_SYSTEM_TIME_US(sec, us) \
|
||||||
extern void sntp_set_system_time(sntp_time_t GMT_Time);
|
do { \
|
||||||
#define SNTP_SET_SYSTEM_TIME sntp_set_system_time
|
struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \
|
||||||
|
settimeofday(&tv, NULL); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------
|
----------------------------------
|
||||||
----- Multicast/IGMP options -----
|
----- Multicast/IGMP options -----
|
||||||
@ -2134,6 +2137,14 @@ extern void sntp_set_system_time(sntp_time_t GMT_Time);
|
|||||||
#if CONFIG_LWIP_IP6_DEBUG
|
#if CONFIG_LWIP_IP6_DEBUG
|
||||||
#define IP6_DEBUG LWIP_DBG_ON
|
#define IP6_DEBUG LWIP_DBG_ON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SNTP_DEBUG: Enable debugging for SNTP.
|
||||||
|
*/
|
||||||
|
#if CONFIG_LWIP_SNTP_DEBUG
|
||||||
|
#define SNTP_DEBUG LWIP_DBG_ON
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user