0
0
FreeRTOSprogramming~10 mins

Task notification vs queue performance in FreeRTOS - Interactive Practice

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

Complete the code to send a task notification to unblock the task.

FreeRTOS
xTaskNotifyGive([1]);
Drag options to blanks, or click blank then click option'
AxSemaphore
BxTaskNotify
CxQueueHandle
DxTaskHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using a queue handle instead of a task handle.
Confusing the notification function with queue send functions.
2fill in blank
medium

Complete the code to receive a notification and unblock the task.

FreeRTOS
ulTaskNotifyTake([1], portMAX_DELAY);
Drag options to blanks, or click blank then click option'
ApdTRUE
BpdFALSE
CpdFAIL
DpdPASS
Attempts:
3 left
💡 Hint
Common Mistakes
Passing pdFALSE which does not clear the notification value.
Using unrelated constants like pdPASS or pdFAIL.
3fill in blank
hard

Fix the error in the queue send function to avoid blocking the task indefinitely.

FreeRTOS
xQueueSend([1], &item, 0);
Drag options to blanks, or click blank then click option'
AxQueue
BxTaskHandle
CxSemaphore
DxNotification
Attempts:
3 left
💡 Hint
Common Mistakes
Using a task handle instead of a queue handle.
Confusing notification handles with queue handles.
4fill in blank
hard

Fill both blanks to create a dictionary mapping task names to their notification counts, filtering tasks with counts greater than 5.

FreeRTOS
task_notifications = {task_name: [1] for task_name, count in tasks.items() if count [2] 5}
Drag options to blanks, or click blank then click option'
Acount
B>
C<
Dtask_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using task names as values instead of counts.
Using the wrong comparison operator.
5fill in blank
hard

Fill all three blanks to create a dictionary of tasks with notification counts above zero, using uppercase task names as keys.

FreeRTOS
active_tasks = {{ [1]: [2] for [3], count in tasks.items() if count > 0 }}
Drag options to blanks, or click blank then click option'
Atask_name.upper()
Bcount
Ctask_name
Dcount > 0
Attempts:
3 left
💡 Hint
Common Mistakes
Using the condition inside the dictionary instead of the comprehension filter.
Mixing up keys and values.