Bird
0
0

What will be the result of the following code snippet?

medium📝 Predict Output Q5 of 15
FreeRTOS - Task Notifications

What will be the result of the following code snippet?

uint32_t val = 5;
xTaskNotify(taskHandle, val, eIncrement);
// Task reads notification value after this call
AThe task's notification value is reset to 0
BThe task's notification value increases by 5
CThe task's notification value is set to 5
DThe task's notification value remains unchanged
Step-by-Step Solution
Solution:
  1. Step 1: Understand eIncrement action

    eIncrement adds the given value to the current notification value of the task.
  2. Step 2: Apply increment to current value

    The task's notification value increases by 5 after the call.
  3. Final Answer:

    The task's notification value increases by 5 -> Option B
  4. Quick Check:

    eIncrement adds value to notification [OK]
Quick Trick: eIncrement adds value to current notification [OK]
Common Mistakes:
  • Confusing increment with set value
  • Assuming value resets to zero
  • Thinking value stays the same

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes