Complete the code to create a FreeRTOS task that runs the function taskFunction.
xTaskCreate([1], "Task1", 1000, NULL, 1, NULL);
The function taskFunction is passed to xTaskCreate to define the task's code.
Complete the code to delay a task for 500 milliseconds using FreeRTOS API.
vTaskDelay([1]);Use pdMS_TO_TICKS(500) to convert milliseconds to ticks for vTaskDelay.
Fix the error in the code that causes a deadlock when two tasks try to take the same mutex.
if(xSemaphoreTake([1], portMAX_DELAY) == pdTRUE) { // critical section xSemaphoreGive([1]); }
The mutex mutex1 must be taken and given properly to avoid deadlocks.
Fill both blanks to correctly check if a queue is full before sending data.
if(uxQueueSpacesAvailable([1]) [2] 0) { xQueueSend([1], &data, 0); }
Check if the queue queueHandle has space available (greater than 0) before sending.
Fill all three blanks to create a dictionary comprehension that maps task names to their stack high water marks if the mark is less than 100.
{ [1]: [2] for [1] in tasks if uxTaskGetStackHighWaterMark([1]) [3] 100 }This comprehension creates a dictionary with task handles as keys and their stack high water marks as values, filtering those below 100.