|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <timeout.hpp>
Public Member Functions | |
| Timeout () | |
| Timeout (uint32_t timeout) | |
| void | restart (uint32_t timeout) |
| void | stop () |
| bool | isStopped () const |
| bool | isExpired () const |
| uint32_t | timeRemaining () const |
| bool | execute () |
Static Public Attributes | |
| static constexpr auto | TimeFunc = T |
Friends | |
| template<typename H > | |
| class | PeriodicTimer |
A class for keeping track of a timer that expires. Template argument expects a function pointer that returns a uin32_t representing some absolute measure of time.
Doesn't start until restart() is called
|
inline |
|
inlineexplicit |
|
inline |
Returns true on the first call when timer has expired since restart. Use to only catch the timeout expiration once.
true the first time the timer has expired (timeout has been reached) since last restart()
|
inline |
true if the timer has expired (timeout has been reached) and is NOT stopped.
|
inline |
true if the timer is stopped
|
inline |
Set the timer to expire in timeout units of time.
| [in] | timeout | the amount of time from when this function is called that the timer should expire. |
|
inline |
Stop the timer. If expired, the expiration flags are cleared.
|
inline |
|
staticconstexpr |