Bird
0
0

What is the key difference between vTaskDelay() and vTaskDelayUntil() in FreeRTOS?

easy📝 Conceptual Q1 of 15
FreeRTOS - Task Scheduling
What is the key difference between vTaskDelay() and vTaskDelayUntil() in FreeRTOS?
A<code>vTaskDelay()</code> is used for precise timing, <code>vTaskDelayUntil()</code> is not.
B<code>vTaskDelayUntil()</code> provides a fixed periodic delay, while <code>vTaskDelay()</code> provides a relative delay.
C<code>vTaskDelayUntil()</code> can only delay for milliseconds, <code>vTaskDelay()</code> can delay for ticks.
DBoth functions behave exactly the same in all scenarios.
Step-by-Step Solution
Solution:
  1. Step 1: Understand vTaskDelay() behavior

    vTaskDelay() delays a task for a relative time from the moment it is called, which can cause drift in periodic tasks.
  2. Step 2: Understand vTaskDelayUntil() behavior

    vTaskDelayUntil() delays a task until a fixed point in time, maintaining a consistent periodic rate without drift.
  3. Final Answer:

    vTaskDelayUntil() provides a fixed periodic delay, while vTaskDelay() provides a relative delay. -> Option B
  4. Quick Check:

    Periodic delay = Fixed timing [OK]
Quick Trick: Use vTaskDelayUntil for fixed periodic timing [OK]
Common Mistakes:
  • Confusing relative and absolute delay behavior
  • Assuming both functions prevent timing drift
  • Thinking vTaskDelayUntil only delays milliseconds

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes