Bird
0
0

Which of the following is the correct prototype for a FreeRTOS ISR handler that defers processing using task notifications?

easy📝 Syntax Q3 of 15
FreeRTOS - Interrupt Management
Which of the following is the correct prototype for a FreeRTOS ISR handler that defers processing using task notifications?
Avoid ISR_Handler(void)
Bvoid ISR_Handler(void) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; xTaskNotifyFromISR(..., &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); }
Cvoid ISR_Handler(void) __attribute__((interrupt))
Dvoid ISR_Handler(void) { vTaskDelay(10); }
Step-by-Step Solution
Solution:
  1. Step 1: Recognize correct ISR with deferred processing

    void ISR_Handler(void) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; xTaskNotifyFromISR(..., &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } shows proper use of xTaskNotifyFromISR and portYIELD_FROM_ISR to defer work.
  2. Step 2: Why other options are incorrect

    A and C lack deferred processing code; D uses vTaskDelay inside ISR which is invalid.
  3. Final Answer:

    ISR with xTaskNotifyFromISR and portYIELD_FROM_ISR -> Option B
  4. Quick Check:

    Correct ISR prototype includes notification and yield macros [OK]
Quick Trick: Use portYIELD_FROM_ISR after notifying task in ISR [OK]
Common Mistakes:
  • Calling vTaskDelay inside ISR
  • Not using portYIELD_FROM_ISR after notification
  • Missing BaseType_t variable for task notification

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes