You want to notify a task from multiple ISRs using ISR-to-task notifications. Which approach ensures the task processes all notifications without missing any?
hard📝 Application Q15 of 15
FreeRTOS - Task Notifications
You want to notify a task from multiple ISRs using ISR-to-task notifications. Which approach ensures the task processes all notifications without missing any?
AUse vTaskNotifyGiveFromISR() once and ulTaskNotifyTake() once; task processes only one notification
BUse xTaskNotifyGive() in ISRs and ulTaskNotifyTake() in task with zero timeout
CUse ulTaskNotifyTake() with clear count and call vTaskNotifyGiveFromISR() in each ISR; task loops to process all notifications
DUse a global variable incremented in ISRs and checked in task without notifications
Step-by-Step Solution
Solution:
Step 1: Understand multiple ISR notifications
Each ISR calls vTaskNotifyGiveFromISR() to increment notification count.
Step 2: Task processes all notifications
Task uses ulTaskNotifyTake(pdTRUE, portMAX_DELAY) in a loop to clear all counts and process each notification.
Final Answer:
Use ulTaskNotifyTake() with clear count and call vTaskNotifyGiveFromISR() in each ISR; task loops to process all notifications -> Option C
Quick Check:
Multiple ISR notifications require counting and looping [OK]
Quick Trick:Loop ulTaskNotifyTake() to handle multiple ISR signals [OK]
Common Mistakes:
Assuming one notification covers all ISR events
Using non-FromISR functions in ISR
Ignoring notification count clearing
Master "Task Notifications" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently