mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
sntp/lwip: Add SNTP_UPDATE_DELAY option in Kconfig
Closes: https://github.com/espressif/esp-idf/issues/2277 Closes: IDFGH-337
This commit is contained in:
parent
c5e89897ef
commit
b107b832ca
@ -84,15 +84,6 @@ menu "LWIP"
|
||||
help
|
||||
Enabling this option allows checking for available data on a netconn.
|
||||
|
||||
config LWIP_DHCP_MAX_NTP_SERVERS
|
||||
int "Maximum number of NTP servers"
|
||||
default 1
|
||||
range 1 16
|
||||
help
|
||||
Set maximum number of NTP servers used by LwIP SNTP module.
|
||||
First argument of sntp_setserver/sntp_setservername functions
|
||||
is limited to this value.
|
||||
|
||||
config LWIP_IP_FRAG
|
||||
bool "Enable fragment outgoing IP packets"
|
||||
default n
|
||||
@ -572,4 +563,26 @@ menu "LWIP"
|
||||
|
||||
endmenu # LWIP RAW API
|
||||
|
||||
menu "SNTP"
|
||||
|
||||
config LWIP_DHCP_MAX_NTP_SERVERS
|
||||
int "Maximum number of NTP servers"
|
||||
default 1
|
||||
range 1 16
|
||||
help
|
||||
Set maximum number of NTP servers used by LwIP SNTP module.
|
||||
First argument of sntp_setserver/sntp_setservername functions
|
||||
is limited to this value.
|
||||
|
||||
config LWIP_SNTP_UPDATE_DELAY
|
||||
int "Request interval to update time (ms)"
|
||||
range 15000 4294967295
|
||||
default 3600000
|
||||
help
|
||||
This option allows you to set the time update period via SNTP.
|
||||
Default is 1 hour. Must not be below 15 seconds by specification.
|
||||
(SNTPv4 RFC 4330 enforces a minimum update time of 15 seconds).
|
||||
|
||||
endmenu # SNTP
|
||||
|
||||
endmenu
|
||||
|
@ -841,6 +841,16 @@ enum {
|
||||
#define LWIP_DHCP_MAX_NTP_SERVERS CONFIG_LWIP_DHCP_MAX_NTP_SERVERS
|
||||
#define LWIP_TIMEVAL_PRIVATE 0
|
||||
|
||||
/*
|
||||
--------------------------------------
|
||||
------------ SNTP options ------------
|
||||
--------------------------------------
|
||||
*/
|
||||
/*
|
||||
* SNTP update delay - in milliseconds
|
||||
*/
|
||||
#define SNTP_UPDATE_DELAY CONFIG_LWIP_SNTP_UPDATE_DELAY
|
||||
|
||||
#define SNTP_SET_SYSTEM_TIME_US(sec, us) \
|
||||
do { \
|
||||
struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \
|
||||
|
Loading…
x
Reference in New Issue
Block a user