Bird
0
0

Why is it important to call portYIELD_FROM_ISR() after xTaskNotifyFromISR() when xHigherPriorityTaskWoken is set?

hard📝 Conceptual Q10 of 15
FreeRTOS - Task Notifications
Why is it important to call portYIELD_FROM_ISR() after xTaskNotifyFromISR() when xHigherPriorityTaskWoken is set?
ATo prevent the ISR from running again
BTo disable interrupts until the task runs
CTo request a context switch to the higher priority task immediately
DTo reset the notification value in the task
Step-by-Step Solution
Solution:
  1. Step 1: Understand xHigherPriorityTaskWoken flag

    This flag indicates a higher priority task was woken by the ISR.
  2. Step 2: Purpose of portYIELD_FROM_ISR

    Calling portYIELD_FROM_ISR requests immediate context switch to that higher priority task.
  3. Final Answer:

    Request immediate context switch to higher priority task -> Option C
  4. Quick Check:

    portYIELD_FROM_ISR triggers immediate task switch [OK]
Quick Trick: Call portYIELD_FROM_ISR to switch to higher priority task [OK]
Common Mistakes:
  • Thinking it disables interrupts
  • Assuming it resets notification value
  • Believing it prevents ISR re-entry

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes