Bird
0
0

Which of the following is the correct way to declare an ISR in FreeRTOS?

easy📝 Syntax Q3 of 15
FreeRTOS - Interrupt Management
Which of the following is the correct way to declare an ISR in FreeRTOS?
Avoid vISR_Handler(void);
Bvoid vISR_Handler() { /* ISR code */ }
Cvoid vISR_Handler(void) __attribute__((interrupt));
Dvoid vISR_Handler(void) __attribute__((interrupt_handler));
Step-by-Step Solution
Solution:
  1. Step 1: Review FreeRTOS ISR declaration requirements

    FreeRTOS ISRs must use compiler and port specific attributes to generate proper ISR prologue/epilogue code.
  2. Step 2: Check syntax correctness

    void vISR_Handler(void) __attribute__((interrupt)); shows the correct declaration using standard GCC interrupt attribute for many FreeRTOS ports.
  3. Final Answer:

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

    ISR declaration = Compiler interrupt attribute [OK]
Quick Trick: FreeRTOS ISRs use compiler-specific interrupt attributes [OK]
Common Mistakes:
  • Declaring ISR as normal function without attribute
  • Omitting function body in declaration
  • Using wrong attribute like interrupt_handler

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes