Complete the code to notify a task using xTaskNotifyGive().
xTaskNotifyGive([1]);The function xTaskNotifyGive() requires the handle of the task to notify. Here, xTaskToNotify is the correct task handle.
Complete the code to wait for a notification as a lightweight semaphore using ulTaskNotifyTake().
ulTaskNotifyTake([1], portMAX_DELAY);pdTRUE which clears the count immediately.The first parameter to ulTaskNotifyTake() is ClearCountOnExit. Passing pdFALSE means the count is not cleared on exit, which is typical for semaphore behavior.
Fix the error in the code to correctly use xTaskNotifyGive() as a semaphore signal.
void signalTask() {
xTaskNotifyGive([1]);
}The function xTaskNotifyGive() must be called with a valid task handle. Using xTaskToNotify ensures the correct task is notified.
Fill both blanks to create a dictionary comprehension that maps task names to their notification counts if count is greater than zero.
taskNotifyCounts = {taskName: [1] for taskName, count in taskCounts.items() if count [2] 0}The dictionary comprehension maps taskName to count only if count > 0.
Fill all three blanks to create a dictionary comprehension that maps uppercase task names to their counts if count is less than 5.
filteredCounts = [1]: [2] for task, count in counts.items() if count [3] 5}
The comprehension maps uppercase task names to counts where count is less than 5.