Which FreeRTOS function is used to disable interrupts and enter a critical section?
easy📝 Syntax Q3 of 15
FreeRTOS - Interrupt Management
Which FreeRTOS function is used to disable interrupts and enter a critical section?
AvTaskSuspendAll()
BtaskENTER_CRITICAL()
CportDISABLE_INTERRUPTS()
DxTaskResumeAll()
Step-by-Step Solution
Solution:
Step 1: Identify the function to disable interrupts
In FreeRTOS, taskENTER_CRITICAL() disables interrupts to protect critical sections.
Step 2: Differentiate from other functions
vTaskSuspendAll() suspends task switching but does not disable interrupts; portDISABLE_INTERRUPTS() is a lower-level macro, not the recommended API; xTaskResumeAll() resumes task switching.
Final Answer:
taskENTER_CRITICAL() -> Option B
Quick Check:
Correct API to disable interrupts for critical section [OK]
Quick Trick:Use taskENTER_CRITICAL() to disable interrupts [OK]
Common Mistakes:
Confusing taskENTER_CRITICAL() with vTaskSuspendAll()
Using portDISABLE_INTERRUPTS() directly instead of API
Assuming xTaskResumeAll() disables interrupts
Master "Interrupt Management" in FreeRTOS
9 interactive learning modes - each teaches the same concept differently