Bird
0
0

Which of the following is the correct way to declare an ISR that uses FreeRTOS API functions?

easy📝 Syntax Q3 of 15
FreeRTOS - Interrupt Management

Which of the following is the correct way to declare an ISR that uses FreeRTOS API functions?

Avoid ISR_Handler(void) __attribute__((naked));
Bvoid ISR_Handler(void) __attribute__((used));
Cvoid ISR_Handler(void) __attribute__((interrupt));
Dvoid ISR_Handler(void) __attribute__((interrupt, used));
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct ISR attribute for FreeRTOS

    FreeRTOS requires ISRs to be declared with the 'interrupt' attribute to handle context saving properly.
  2. Step 2: Check other attributes

    'used' and 'naked' are not standard for FreeRTOS ISR declarations and may cause issues.
  3. Final Answer:

    void ISR_Handler(void) __attribute__((interrupt)); -> Option C
  4. Quick Check:

    ISR declaration with interrupt attribute = Correct [OK]
Quick Trick: Use __attribute__((interrupt)) for FreeRTOS ISRs [OK]
Common Mistakes:
  • Using __attribute__((naked)) which lacks prologue/epilogue
  • Omitting interrupt attribute causing wrong context save
  • Adding unrelated attributes like 'used'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes