Template Class Timeout
Defined in File timeout.hpp
Class Documentation
-
template<uint32_t (*T)()>
class Timeout 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 calledPublic Functions
-
inline Timeout()
-
inline explicit Timeout(uint32_t timeout)
-
inline void restart(uint32_t timeout)
Set the timer to expire in
timeout
units of time.- Parameters:
timeout – [in] the amount of time from when this function is called that the timer should expire.
-
inline void stop()
Stop the timer. If expired, the expiration flags are cleared.
-
inline bool isStopped() const
- Returns:
true
if the timer is stopped
-
inline bool isExpired() const
- Returns:
true
if the timer has expired (timeout has been reached) and is NOT stopped.
-
inline uint32_t timeRemaining() const
- Returns:
time left in timer if still running and not yet expired
-
inline Timeout()