8 Software TImers Flashcards
What is a software timer?
A softwire timer is a timer that doesn’t use any additional hardware resources, it can be set to one shot or auto-reload. The software timer is implemented int the daemon task.
Where is the software timer implemented?
The software task is implemented in the daemon task.
When does the software timer use cpu processing time?
The software only uses cpu processing time when the software timer callback function is executing.
When will the software callback function execute?
Once the software timer period expires.
What is the daemon task?
The daemon task is ran in the kernel on the beginning of the scheduler.
How many States does a software timer have?
2, Dormant and Running.
Explain the dormant state
Dormant – Software timer exists but isn’t running. State when timer is created (xTimerCreate) or stopped (xTimerStop).
Explain the running state
Running – State after starting (xTimerStart), resetting (xTimerReset), or changing timer period (xTimerChangePeriod). Timer callback will execute after the timer period has elapsed.
Create a software timer.
xTimerCreate(“OneShot Timer”, pdMS_TO_TICKS(2000), pdFALSE, 0, oneShotTimerCallback)
What API calls are there to control a software timer?
xTimerStart() to start the timer.
xTimerStop() to stop the timer.
xTimerReset() to reset the timer.