From d4a3af987d3348f39e66fd331c6916d5dde0ec56 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Wed, 27 Mar 2019 19:37:47 +0100 Subject: [PATCH] timsync.cpp: field validation t_msec --- src/timesync.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timesync.cpp b/src/timesync.cpp index 2fbe6957..b0aedacf 100644 --- a/src/timesync.cpp +++ b/src/timesync.cpp @@ -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