Bird
0
0

Given this ISR code snippet, what will be the value of higherPriorityTaskWoken after calling xQueueSendFromISR if a higher priority task was woken?

medium📝 Predict Output Q4 of 15
FreeRTOS - Interrupt Management
Given this ISR code snippet, what will be the value of higherPriorityTaskWoken after calling xQueueSendFromISR if a higher priority task was woken?
BaseType_t higherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR(queue, &data, &higherPriorityTaskWoken);
AUndefined
BpdTRUE
CNULL
DpdFALSE
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of higherPriorityTaskWoken

    This flag is set to pdTRUE by xQueueSendFromISR if sending the item caused a higher priority task to unblock.
  2. Step 2: Analyze the scenario

    If a higher priority task was woken, the flag changes from pdFALSE to pdTRUE.
  3. Final Answer:

    pdTRUE -> Option B
  4. Quick Check:

    Higher priority task woken flag = pdTRUE [OK]
Quick Trick: Check higherPriorityTaskWoken after FromISR calls to trigger context switch [OK]
Common Mistakes:
  • Assuming flag stays pdFALSE always
  • Confusing NULL with pdFALSE
  • Ignoring the flag update by FromISR functions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes