Complete the code to create a one-shot timer in FreeRTOS.
TimerHandle_t timer = xTimerCreate("Timer", pdMS_TO_TICKS(1000), [1], NULL, timerCallback);
Use pdFALSE to create a one-shot timer that runs only once.
Complete the code to create an auto-reload timer in FreeRTOS.
TimerHandle_t timer = xTimerCreate("Timer", pdMS_TO_TICKS(500), [1], NULL, timerCallback);
Use pdTRUE to create an auto-reload timer that restarts automatically.
Fix the error in the timer start code to start the timer correctly.
BaseType_t started = xTimerStart(timer, [1]);The block time parameter should be 0 to start the timer without blocking.
Fill both blanks to create a one-shot timer and start it without blocking.
TimerHandle_t timer = xTimerCreate("Timer", [1], [2], NULL, timerCallback); xTimerStart(timer, 0);
The timer period is set to 1000 ms and pdFALSE makes it one-shot.
Fill all three blanks to create an auto-reload timer, start it, and stop it properly.
TimerHandle_t timer = xTimerCreate("Timer", [1], [2], NULL, timerCallback); BaseType_t started = xTimerStart(timer, [3]); if(started == pdPASS) { // Timer started successfully }
The timer period is 500 ms, auto-reload is enabled with pdTRUE, and start is called with 0 block time.
