0
0
FreeRTOSprogramming~10 mins

Why task notifications are lightweight 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 send a task notification in FreeRTOS.

FreeRTOS
xTaskNotifyGive([1]);
Drag options to blanks, or click blank then click option'
AxTaskToNotify
BxTaskHandle
CxQueueHandle
DxSemaphore
Attempts:
3 left
💡 Hint
Common Mistakes
Using a queue or semaphore handle instead of a task handle.
Confusing the task handle variable name.
2fill in blank
medium

Complete the code to wait for a task notification with a timeout.

FreeRTOS
ulTaskNotifyTake([1], pdMS_TO_TICKS(1000));
Drag options to blanks, or click blank then click option'
ApdPASS
BpdTRUE
CportMAX_DELAY
DpdFALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using pdFALSE which does not clear the notification value.
Confusing the parameter with timeout values.
3fill in blank
hard

Fix the error in the code to send a notification with a value.

FreeRTOS
xTaskNotify([1], 0x01, eSetBits);
Drag options to blanks, or click blank then click option'
AxTaskToNotify
BxTaskHandle
CNULL
DxQueueHandle
Attempts:
3 left
💡 Hint
Common Mistakes
Passing NULL or queue handle instead of task handle.
Using an undefined variable name.
4fill in blank
hard

Fill both blanks to create a task notification value and check if a bit is set.

FreeRTOS
uint32_t notifValue = [1];
if (notifValue [2] 0x01) {
    // Bit 0 is set
}
Drag options to blanks, or click blank then click option'
AulTaskNotifyValueClear(NULL, 0x01)
B&
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using bitwise OR instead of AND for checking bits.
Not clearing notification bits properly.
5fill in blank
hard

Fill all three blanks to send a notification, wait for it, and clear the value.

FreeRTOS
xTaskNotify([1], 0x02, eSetBits);
uint32_t value = ulTaskNotifyTake([2], portMAX_DELAY);
value = ulTaskNotifyValueClear([3], 0x02);
Drag options to blanks, or click blank then click option'
AxTaskToNotify
BpdTRUE
DpdFALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using different task handles for send and clear.
Using pdFALSE which does not clear notification value.