Bird
0
0

Which of the following is the correct way to declare a variable to track if a higher priority task was woken inside an ISR?

easy📝 Syntax Q12 of 15
FreeRTOS - Interrupt Management

Which of the following is the correct way to declare a variable to track if a higher priority task was woken inside an ISR?

?
Aint higherPriorityTaskWoken = 0;
Bbool higherPriorityTaskWoken = false;
CBaseType_t higherPriorityTaskWoken = pdFALSE;
Dvolatile int higherPriorityTaskWoken = 1;
Step-by-Step Solution
Solution:
  1. Step 1: Identify FreeRTOS type for ISR task wake flag

    FreeRTOS uses BaseType_t for portability and defines pdFALSE and pdTRUE for boolean values.
  2. Step 2: Correct initialization

    The variable must start as pdFALSE to indicate no task was woken yet.
  3. Final Answer:

    BaseType_t higherPriorityTaskWoken = pdFALSE; -> Option C
  4. Quick Check:

    Use BaseType_t and pdFALSE for ISR flags [OK]
Quick Trick: Use BaseType_t and pdFALSE to track task wake in ISR [OK]
Common Mistakes:
  • Using plain int instead of BaseType_t
  • Initializing flag to 1 instead of pdFALSE
  • Using bool which may not be portable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes