Bird
0
0

Given this code snippet:

medium📝 Predict Output Q4 of 15
FreeRTOS - RTOS Fundamentals
Given this code snippet:
TickType_t start = xTaskGetTickCount();
vTaskDelay(10);
TickType_t end = xTaskGetTickCount();
TickType_t diff = end - start;

What is the expected value of diff?
A0
B10
C1
DDepends on CPU speed
Step-by-Step Solution
Solution:
  1. Step 1: Understand vTaskDelay effect

    vTaskDelay(10) delays the task for 10 tick periods.
  2. Step 2: Calculate tick difference

    Tick count increases by 10 during delay, so diff = 10.
  3. Final Answer:

    10 -> Option B
  4. Quick Check:

    Tick difference after delay = 10 [OK]
Quick Trick: vTaskDelay delays task by given tick count [OK]
Common Mistakes:
  • Assuming delay does not increase tick count
  • Thinking tick count depends on CPU speed
  • Confusing delay time with milliseconds

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes