Which of the following correctly delays a FreeRTOS task for 10 tick periods?
easy📝 Syntax Q3 of 15
FreeRTOS - Task Scheduling
Which of the following correctly delays a FreeRTOS task for 10 tick periods?
AvTaskDelay(10 / portTICK_PERIOD_MS);
BvTaskDelay(10);
CvTaskDelay(10 * portTICK_PERIOD_MS);
DvTaskDelayUntil(10);
Step-by-Step Solution
Solution:
Step 1: Understand vTaskDelay parameter
The parameter to vTaskDelay() is the number of tick periods to delay.
Step 2: Analyze options
vTaskDelay(10); directly delays for 10 ticks, which is correct. vTaskDelay(10 / portTICK_PERIOD_MS); divides by tick period, which is incorrect. vTaskDelay(10 * portTICK_PERIOD_MS); multiplies by tick period, which is also incorrect. vTaskDelayUntil(10); uses vTaskDelayUntil incorrectly.
Final Answer:
vTaskDelay(10); -> Option B
Quick Check:
vTaskDelay parameter is ticks, not milliseconds [OK]
Quick Trick:vTaskDelay parameter is tick count, not ms [OK]
Common Mistakes:
Confusing ticks with milliseconds
Using vTaskDelayUntil instead of vTaskDelay
Multiplying or dividing by portTICK_PERIOD_MS incorrectly
Master "Task Scheduling" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently