Bird
0
0

Which of the following is the correct way to create a task with priority 3 in FreeRTOS?

easy📝 Syntax Q3 of 15
FreeRTOS - Task Scheduling
Which of the following is the correct way to create a task with priority 3 in FreeRTOS?
AxTaskCreate(taskFunction, "Task1", 1000, NULL, -1, NULL);
BxTaskCreate(taskFunction, "Task1", 1000, NULL, 0, NULL);
CxTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL);
DxTaskCreate(taskFunction, "Task1", 1000, NULL, 10, NULL);
Step-by-Step Solution
Solution:
  1. Step 1: Understand xTaskCreate parameters

    The fifth parameter is the task priority; valid priorities are non-negative integers within configMAX_PRIORITIES.
  2. Step 2: Check options for valid priority

    xTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL); uses priority 3, which is valid. xTaskCreate(taskFunction, "Task1", 1000, NULL, 0, NULL); uses 0 (lowest priority), C uses -1 (invalid), D uses 10 (may be invalid if max priorities < 11).
  3. Final Answer:

    xTaskCreate(taskFunction, "Task1", 1000, NULL, 3, NULL); -> Option C
  4. Quick Check:

    Priority parameter is fifth and must be valid integer [OK]
Quick Trick: Priority is the 5th parameter in xTaskCreate [OK]
Common Mistakes:
  • Using negative priority values
  • Confusing stack size with priority
  • Setting priority higher than configMAX_PRIORITIES

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes