Bird
0
0

What is wrong with this priority assignment if configMAX_PRIORITIES is 3?

medium📝 Debug Q14 of 15
FreeRTOS - Task Priorities
What is wrong with this priority assignment if configMAX_PRIORITIES is 3?
vTaskPrioritySet(taskHandle, 3);
APriority 3 is valid and highest
BPriority 3 is out of range; max is 2
CPriority must be zero
DPriority must be negative
Step-by-Step Solution
Solution:
  1. Step 1: Check allowed priority range

    Priorities go from 0 to configMAX_PRIORITIES - 1, so 0 to 2 here.
  2. Step 2: Validate assigned priority

    Priority 3 is outside this range and invalid.
  3. Final Answer:

    Priority 3 is out of range; max is 2 -> Option B
  4. Quick Check:

    Max priority = 2, 3 is invalid [OK]
Quick Trick: Priority must be less than configMAX_PRIORITIES [OK]
Common Mistakes:
  • Using configMAX_PRIORITIES as a valid priority
  • Assigning negative priorities
  • Assuming priority zero is highest

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes