0
0
FreeRTOSprogramming~10 mins

Task priority assignment 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 create a task with priority 2.

FreeRTOS
xTaskCreate(taskFunction, "Task1", 1000, NULL, [1], NULL);
Drag options to blanks, or click blank then click option'
A2
B0
C5
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 as priority which is the idle priority.
Confusing stack size with priority.
2fill in blank
medium

Complete the code to set the priority of an existing task to 3.

FreeRTOS
vTaskPrioritySet([1], 3);
Drag options to blanks, or click blank then click option'
AxTaskHandle
BNULL
CtaskFunction
DxQueueHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Passing NULL which changes the priority of the current task.
Passing the task function name instead of the handle.
3fill in blank
hard

Fix the error in setting the task priority to 4 for a task handle named myTaskHandle.

FreeRTOS
vTaskPrioritySet(myTaskHandle, [1]);
Drag options to blanks, or click blank then click option'
A"4"
B4
CHIGH
Dpriority
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string instead of an integer for priority.
Using undefined constants.
4fill in blank
hard

Fill both blanks to create a task with priority 5 and stack size 2000.

FreeRTOS
xTaskCreate(taskFunction, "Task2", [1], NULL, [2], NULL);
Drag options to blanks, or click blank then click option'
A2000
B1000
C5
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping stack size and priority parameters.
Using too small stack size for the task.
5fill in blank
hard

Fill all three blanks to create a task with name "Logger", priority 3, and stack size 1500.

FreeRTOS
xTaskCreate([1], [2], [3], NULL, 3, NULL);
Drag options to blanks, or click blank then click option'
AloggerTask
B"Logger"
C1500
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using stack size as a string.
Confusing task name and function name.
Using wrong priority value.