timsync.cpp: field validation t_msec

This commit is contained in:
Verkehrsrot 2019-03-27 19:37:47 +01:00
parent 17a1ae2856
commit d4a3af987d

View File

@ -214,7 +214,7 @@ int adjustTime(uint32_t t_sec, uint16_t t_msec) {
if (timeIsValid(time_to_set)) {
// wait until top of second with millisecond precision
vTaskDelay(pdMS_TO_TICKS(1000 - t_msec));
vTaskDelay(pdMS_TO_TICKS(1000 - t_msec < 1000 ? t_msec : 1000));
#ifdef HAS_RTC
time_to_set++; // advance time 1 sec wait time