0
0
FreeRTOSprogramming~10 mins

Priority numbering in FreeRTOS - Interactive Code Practice

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

Complete the code to set a task priority to the highest level in FreeRTOS.

FreeRTOS
vTaskPrioritySet(taskHandle, [1]);
Drag options to blanks, or click blank then click option'
AconfigMAX_PRIORITIES - 1
BconfigMAX_PRIORITIES
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMAX_PRIORITIES as the highest priority causes errors.
Setting priority to 0 is the lowest priority, not highest.
2fill in blank
medium

Complete the code to create a task with priority 2 in FreeRTOS.

FreeRTOS
xTaskCreate(taskFunction, "Task", 1000, NULL, [1], NULL);
Drag options to blanks, or click blank then click option'
AconfigMAX_PRIORITIES
BconfigMAX_PRIORITIES - 1
C2
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMAX_PRIORITIES as priority causes errors.
Setting priority to 0 creates the lowest priority task.
3fill in blank
hard

Fix the error in setting a task priority to the highest level.

FreeRTOS
vTaskPrioritySet(taskHandle, [1]);
Drag options to blanks, or click blank then click option'
A1
BconfigMAX_PRIORITIES
C0
DconfigMAX_PRIORITIES - 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMAX_PRIORITIES instead of configMAX_PRIORITIES - 1.
Confusing priority numbering starting at zero.
4fill in blank
hard

Fill both blanks to create a task with the lowest priority and then increase its priority by 1.

FreeRTOS
xTaskCreate(taskFunc, "Task", 500, NULL, [1], &handle);
vTaskPrioritySet(handle, handle->uxPriority [2] 1);
Drag options to blanks, or click blank then click option'
A0
B+
C-
DconfigMAX_PRIORITIES - 1
Attempts:
3 left
💡 Hint
Common Mistakes
Using configMAX_PRIORITIES as initial priority causes errors.
Using '-' instead of '+' decreases priority.
5fill in blank
hard

Fill all three blanks to create a task with priority 3, then set its priority to the highest level.

FreeRTOS
xTaskCreate(func, "Tsk", 256, NULL, [1], &h);
vTaskPrioritySet(h, [2]);
configASSERT([3] <= configMAX_PRIORITIES - 1);
Drag options to blanks, or click blank then click option'
A3
BconfigMAX_PRIORITIES - 1
Ch->uxPriority
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or configMAX_PRIORITIES as priority values incorrectly.
Not using the task handle's priority for assertion.