Bird
0
0

Consider this code snippet:

medium📝 Predict Output Q13 of 15
FreeRTOS - Task Notifications
Consider this code snippet:
uint32_t count = ulTaskNotifyTake(pdFALSE, portMAX_DELAY);
// Assume 3 notifications were sent before this call
What will be the value of count after this call?
A1
B0
C3
DportMAX_DELAY
Step-by-Step Solution
Solution:
  1. Step 1: Analyze xClearCountOnExit parameter

    pdFALSE means the notification count is not cleared on exit, so it counts all notifications received.
  2. Step 2: Understand the count returned

    Since 3 notifications were sent before, ulTaskNotifyTake() returns the total count, which is 3.
  3. Final Answer:

    3 -> Option C
  4. Quick Check:

    pdFALSE keeps count, so count = 3 [OK]
Quick Trick: pdFALSE keeps count, so returns total notifications [OK]
Common Mistakes:
  • Assuming count resets to 1 regardless
  • Confusing portMAX_DELAY as return value
  • Thinking count is zero if notifications sent before

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes