May 2020
Intermediate to advanced
496 pages
13h 54m
English
A oneshot is a timer that fires only one time. These types of timers are common in both hardware and software and come in very handy when a fixed delay is desired. A oneshot timer can be used when you wish to execute a short piece of code after a fixed delay, without blocking the calling code by using vTaskDelay(). To set up a oneshot timer, a timer callback must be specified and a timer created.
The following is an excerpt from mainSoftwareTimers.c:
void oneShotCallBack( TimerHandle_t xTimer );