mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-23 22:56:00 +00:00
sntp: use randomized startup delay ([0..5] seconds) by default (if LWIP_RAND is available)
This commit is contained in:
parent
65b8316459
commit
f4730e78f8
|
@ -140,14 +140,18 @@
|
||||||
* Turned off by default.
|
* Turned off by default.
|
||||||
*/
|
*/
|
||||||
#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__
|
#if !defined SNTP_STARTUP_DELAY || defined __DOXYGEN__
|
||||||
|
#ifdef LWIP_RAND
|
||||||
|
#define SNTP_STARTUP_DELAY 1
|
||||||
|
#else
|
||||||
#define SNTP_STARTUP_DELAY 0
|
#define SNTP_STARTUP_DELAY 0
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/** If you want the startup delay to be a function, define this
|
/** If you want the startup delay to be a function, define this
|
||||||
* to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
|
* to a function (including the brackets) and define SNTP_STARTUP_DELAY to 1.
|
||||||
*/
|
*/
|
||||||
#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__
|
#if !defined SNTP_STARTUP_DELAY_FUNC || defined __DOXYGEN__
|
||||||
#define SNTP_STARTUP_DELAY_FUNC SNTP_STARTUP_DELAY
|
#define SNTP_STARTUP_DELAY_FUNC (LWIP_RAND() % 5000)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** SNTP receive timeout - in milliseconds
|
/** SNTP receive timeout - in milliseconds
|
||||||
|
|
Loading…
Reference in New Issue
Block a user