Bird
0
0

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:
  1. Step 1: Identify the function to disable interrupts

    In FreeRTOS, taskENTER_CRITICAL() disables interrupts to protect critical sections.
  2. 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.
  3. Final Answer:

    taskENTER_CRITICAL() -> Option B
  4. 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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes