0
0
FreeRTOSprogramming~10 mins

Why priority design matters in FreeRTOS - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the task priority correctly.

FreeRTOS
xTaskCreate(TaskFunction, "Task1", 1000, NULL, [1], NULL);
Drag options to blanks, or click blank then click option'
AconfigMAX_PRIORITIES + 1
B0
CtskIDLE_PRIORITY + 1
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting priority to 0 causes the task to have idle priority.
Using negative or out-of-range priorities causes errors.
2fill in blank
medium

Complete the code to create a high priority task.

FreeRTOS
xTaskCreate(TaskFunction, "HighPriorityTask", 1000, NULL, [1], NULL);
Drag options to blanks, or click blank then click option'
A1
BtskIDLE_PRIORITY
CconfigMAX_PRIORITIES + 1
DconfigMAX_PRIORITIES - 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMAX_PRIORITIES causes invalid priority error.
Using idle priority for high priority tasks causes scheduling issues.
3fill in blank
hard

Fix the error in the priority assignment.

FreeRTOS
vTaskPrioritySet(TaskHandle, [1]);
Drag options to blanks, or click blank then click option'
AtskIDLE_PRIORITY + 2
BconfigMAX_PRIORITIES
C-1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting priority to configMAX_PRIORITIES causes errors.
Negative priorities are invalid.
4fill in blank
hard

Fill both blanks to create a medium priority task and set its priority.

FreeRTOS
xTaskCreate(TaskFunction, "MediumTask", 1000, NULL, [1], &TaskHandle);
vTaskPrioritySet(TaskHandle, [2]);
Drag options to blanks, or click blank then click option'
AtskIDLE_PRIORITY + 2
BtskIDLE_PRIORITY + 1
DconfigMAX_PRIORITIES
Attempts:
3 left
💡 Hint
Common Mistakes
Using different priorities for creation and setting causes confusion.
Using invalid priority values causes runtime errors.
5fill in blank
hard

Fill all three blanks to create a task, set its priority, and delete it properly.

FreeRTOS
xTaskCreate(TaskFunction, "TempTask", 1000, NULL, [1], &TaskHandle);
vTaskPrioritySet(TaskHandle, [2]);
vTaskDelete([3]);
Drag options to blanks, or click blank then click option'
AtskIDLE_PRIORITY + 1
CTaskHandle
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Deleting task with NULL handle does nothing.
Using inconsistent priorities causes unexpected behavior.