Bird
0
0

Which of the following is the correct syntax to send an item to a queue from an ISR in FreeRTOS?

easy📝 Syntax Q3 of 15
FreeRTOS - Interrupt Management
Which of the following is the correct syntax to send an item to a queue from an ISR in FreeRTOS?
AxQueueSend(queueHandle, &item, portMAX_DELAY);
BxQueueSendFromISR(queueHandle, &item, &higherPriorityTaskWoken);
CxQueueSendFromISR(queueHandle, item, NULL);
DxQueueSend(queueHandle, item, 0);
Step-by-Step Solution
Solution:
  1. Step 1: Identify ISR-safe queue send function

    Inside ISR, use xQueueSendFromISR which requires a pointer to the item and a pointer to the wake flag.
  2. Step 2: Check parameters correctness

    Parameters must be queue handle, address of item, and address of higherPriorityTaskWoken flag.
  3. Final Answer:

    xQueueSendFromISR(queueHandle, &item, &higherPriorityTaskWoken); -> Option B
  4. Quick Check:

    ISR queue send syntax = xQueueSendFromISR(queueHandle, &item, &higherPriorityTaskWoken); [OK]
Quick Trick: Use &item and &flag pointers in FromISR functions [OK]
Common Mistakes:
  • Using normal xQueueSend inside ISR
  • Passing item instead of &item
  • Passing NULL instead of wake flag pointer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes