0
0
FreeRTOSprogramming~10 mins

ulTaskNotifyTake() for binary/counting notification 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 wait for a notification using ulTaskNotifyTake.

FreeRTOS
uint32_t ulNotificationValue = ulTaskNotifyTake(pdTRUE, [1]);
Drag options to blanks, or click blank then click option'
AportMAX_DELAY
B0
C1000
DpdFALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 as block time causes no waiting and immediate return.
Using pdFALSE instead of a block time is incorrect.
2fill in blank
medium

Complete the code to clear the notification value on exit.

FreeRTOS
uint32_t ulNotificationValue = ulTaskNotifyTake([1], portMAX_DELAY);
Drag options to blanks, or click blank then click option'
A0
BpdFALSE
C1
DpdTRUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using pdFALSE keeps the notification count unchanged.
Using 0 or 1 instead of pdTRUE or pdFALSE can cause confusion.
3fill in blank
hard

Fix the error in the code to correctly receive a counting notification.

FreeRTOS
uint32_t ulNotificationValue = ulTaskNotifyTake(pdTRUE, [1]);
Drag options to blanks, or click blank then click option'
A0
B-1
CportMAX_DELAY
DpdFALSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 causes no wait and immediate return.
Using negative values is invalid.
4fill in blank
hard

Fill both blanks to create a counting notification wait that clears on exit and waits forever.

FreeRTOS
uint32_t ulNotificationValue = ulTaskNotifyTake([1], [2]);
Drag options to blanks, or click blank then click option'
ApdTRUE
BpdFALSE
CportMAX_DELAY
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping parameters causes wrong behavior.
Using 0 as block time causes no wait.
5fill in blank
hard

Fill all three blanks to check if a notification was received and print its value.

FreeRTOS
uint32_t ulNotificationValue = ulTaskNotifyTake([1], [2]);
if (ulNotificationValue [3] 0) {
    printf("Notification count: %u\n", ulNotificationValue);
}
Drag options to blanks, or click blank then click option'
ApdTRUE
BportMAX_DELAY
C>
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using == 0 checks for no notification, not received.
Not clearing count can cause repeated notifications.