|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <periodic_timer.hpp>
Public Member Functions | |
| PeriodicTimer () | |
| PeriodicTimer (uint32_t period) | |
| void | restart () |
| void | restart (uint32_t period) |
| void | stop () |
| bool | execute () |
| bool | isStopped () const |
A timer class which unlike the Timeout class will restart when execute is called and returns that the timer has expired. Keeps its expire times aligned with the given timeout period (i.e.: the timeout time will always be a multiple of the period it is constructed to timeout in +/- some constant due to program startup time)
|
inline |
|
inlineexplicit |
|
inline |
Returns true on the first call when timer has expired since restart(). If timer is checked and has expired, next expiration time is set to the closest time which is an integer product of the period away from the time this timer expired.
true the first time the timer has expired (timeout has been reached) since last restart()
|
inline |
true if the timer is stopped
|
inline |
Set the timer to expire period units of time away from the time at which this function was called.
|
inline |
Similar to restart() but redefine the period of the timer.
| [in] | period | the new period to use for this PeriodicTimer |
|
inline |
Stop the timer.