Bird
0
0

What will be the value of count after this code runs?

medium📝 Predict Output Q5 of 15
FreeRTOS - Task Notifications
What will be the value of count after this code runs?
uint32_t count = ulTaskNotifyTake(pdTRUE, 0);
// Notification count was 5 before call
AportMAX_DELAY
B0
C1
D5
Step-by-Step Solution
Solution:
  1. Step 1: Understand parameters and initial count

    xClearCountOnExit is pdTRUE, so count resets after return. Initial count is 5.
  2. Step 2: Consider wait time zero

    Wait time zero means no blocking; function returns immediately with current count.
  3. Final Answer:

    5 -> Option D
  4. Quick Check:

    Count returned before clearing = 5 [OK]
Quick Trick: Count returned before clearing even with zero wait [OK]
Common Mistakes:
  • Assuming zero wait returns zero count
  • Thinking count clears before return
  • Confusing wait time with count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes