Complete the code to start the FreeRTOS scheduler.
vTaskStartScheduler[1];The function vTaskStartScheduler() starts the FreeRTOS scheduler and takes no parameters, so it requires parentheses.
Complete the code to create a FreeRTOS task with the correct priority.
xTaskCreate(taskFunction, "Task1", configMINIMAL_STACK_SIZE, NULL, [1], NULL);
The priority parameter is usually set to a value between tskIDLE_PRIORITY (0) and configMAX_PRIORITIES - 1. Here, 1 is a valid priority above idle.
Fix the error in the tick hook function declaration.
void vApplicationTickHook[1]The tick hook function must be declared with void parameter list: void vApplicationTickHook(void).
Fill both blanks to create a dictionary of task names and their states.
const char* taskStates[] = {"Running", "Ready", "Blocked", "Suspended"};
for(int i = 0; i < [1]; i++) {
printf("Task %s is %s\n", taskNames[i], taskStates[[2]]);
}The loop should run for the number of tasks returned by uxTaskGetNumberOfTasks(). The index i is used to access the current task state.
Fill all three blanks to correctly implement a tick hook that increments a counter and yields if needed.
static BaseType_t xHigherPriorityTaskWoken = pdFALSE;
void vApplicationTickHook(void) {
[1]++;
if (xSemaphoreGiveFromISR(xSemaphore, &[2]) == pdTRUE) {
port[3]();
}
}The tick count variable ulTickCount is incremented. The xHigherPriorityTaskWoken flag is passed to the semaphore function. If a higher priority task was woken, portYIELD_FROM_ISR() is called to request a context switch.