File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -244,9 +244,18 @@ config NET_CONFIG_SNTP_INIT_RESYNC
244
244
Perform an SNTP request over networking periodically to get and
245
245
absolute wall clock time, and resync system time from it.
246
246
247
+ if NET_CONFIG_SNTP_INIT_RESYNC
248
+
247
249
config NET_CONFIG_SNTP_INIT_RESYNC_INTERVAL
248
250
int "SNTP resync interval (sec)"
249
- depends on NET_CONFIG_SNTP_INIT_RESYNC
250
251
default 3600
251
252
253
+ config NET_CONFIG_SNTP_INIT_RESYNC_ON_FAILURE_INTERVAL
254
+ int "SNTP resync interval (sec) on failure"
255
+ default NET_CONFIG_SNTP_INIT_RESYNC_INTERVAL
256
+ help
257
+ If the SNTP request fails, then this is the interval to wait
258
+ before trying again.
259
+
260
+ endif # NET_CONFIG_SNTP_INIT_RESYNC
252
261
endif # NET_CONFIG_CLOCK_SNTP_INIT
Original file line number Diff line number Diff line change @@ -54,8 +54,10 @@ int net_init_clock_via_sntp(void)
54
54
55
55
end :
56
56
#ifdef CONFIG_NET_CONFIG_SNTP_INIT_RESYNC
57
- k_work_reschedule (& sntp_resync_work_handle ,
58
- K_SECONDS (CONFIG_NET_CONFIG_SNTP_INIT_RESYNC_INTERVAL ));
57
+ k_work_reschedule (
58
+ & sntp_resync_work_handle ,
59
+ (res < 0 ) ? K_SECONDS (CONFIG_NET_CONFIG_SNTP_INIT_RESYNC_ON_FAILURE_INTERVAL )
60
+ : K_SECONDS (CONFIG_NET_CONFIG_SNTP_INIT_RESYNC_INTERVAL ));
59
61
#endif
60
62
return res ;
61
63
}
You can’t perform that action at this time.
0 commit comments