vTaskDelay and vTaskDelayUntil Strange Behavior

With a tick period of 1ms you have a time granularity of 1ms using integer maths (no floating point). So a request for a 7ms delay will be close to 6.0001ms if the call to vTaskDelay() is immediately before the next tick interrupt (because the next tick counts as 1ms having passed as there is a resolution of 1ms), or close to 6.9999ms if the call to vTaskDelay() is immediately after the last tick interrupt. Most will be somewhere in between.

2 Likes