kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'feature/sntp_update_delay' into 'master'
sntp/l_ip: Add SNTP_UPDATE_DELAY option in Kconfig Closes IDFGH-337 See merge request idf/esp-idf!5271pull/3701/head
commit
8dc8dd5689
|
@ -90,15 +90,6 @@ menu "LWIP"
|
||||||
help
|
help
|
||||||
Enabling this option allows checking for available data on a netconn.
|
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
|
config LWIP_IP_FRAG
|
||||||
bool "Enable fragment outgoing IP packets"
|
bool "Enable fragment outgoing IP packets"
|
||||||
default n
|
default n
|
||||||
|
@ -578,4 +569,26 @@ menu "LWIP"
|
||||||
|
|
||||||
endmenu # LWIP RAW API
|
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
|
endmenu
|
||||||
|
|
|
@ -841,6 +841,16 @@ enum {
|
||||||
#define LWIP_DHCP_MAX_NTP_SERVERS CONFIG_LWIP_DHCP_MAX_NTP_SERVERS
|
#define LWIP_DHCP_MAX_NTP_SERVERS CONFIG_LWIP_DHCP_MAX_NTP_SERVERS
|
||||||
#define LWIP_TIMEVAL_PRIVATE 0
|
#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) \
|
#define SNTP_SET_SYSTEM_TIME_US(sec, us) \
|
||||||
do { \
|
do { \
|
||||||
struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \
|
struct timeval tv = { .tv_sec = sec, .tv_usec = us }; \
|
||||||
|
|
Ładowanie…
Reference in New Issue