-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
Fully Compatible
-
ALL
-
v5.0
-
Service Arch 2021-08-09
-
33
-
1
waitForConditionOrInterruptUntil relies on our defined waitForConditionOrInterruptNoAssertUntil, which sleeps for kPrecision milliseconds before waking to check deadline in a loop. The comment suggests that kPrecision is to deal with inaccuracies, but is used in waitForConditionOrInterruptNoAssertUntil as an interval between sleeps. Then the problem would be that if Date_t::now() == 3:59.99 and deadline == 4:00.00 for example, the next iteration of the loop would be no earlier than Date_t::now() == 4:00.04. Therefore, the time needed for scheduling and timing inaccuracies could cause the end time to be greater than the deadline time. Suggested changes: use sleepFor function instead of a loop + sleep intervals.