Volatile version of Metro class for interrupt-safe operations.
More...
#include <metro.h>
|
| VolatileMetro (unsigned long interval_millis, uint8_t autoreset=0) |
| Constructor to initialize the timer with a given interval and autoreset behavior.
|
|
void | interval (unsigned long interval_millis) volatile |
| Sets a new interval for the timer.
|
|
bool | check () volatile |
| Checks if the interval has passed and resets the timer if true.
|
|
bool | checkWithoutReset () const volatile |
| Checks if the interval has passed without resetting the timer.
|
|
void | reset () volatile |
| Resets the timer to the current time.
|
|
Volatile version of Metro class for interrupt-safe operations.
This class provides the same functionality as Metro but with volatile qualifiers to ensure safe access from interrupt handlers and multi-threaded contexts.
Definition at line 135 of file metro.h.
◆ VolatileMetro()
VolatileMetro::VolatileMetro |
( |
unsigned long |
interval_millis, |
|
|
uint8_t |
autoreset = 0 |
|
) |
| |
|
inline |
Constructor to initialize the timer with a given interval and autoreset behavior.
- Parameters
-
interval_millis | The interval in milliseconds for the timer |
autoreset | If set to non-zero, the timer will reset automatically upon a successful check |
Definition at line 174 of file metro.h.
◆ check()
bool VolatileMetro::check |
( |
| ) |
volatile |
|
inline |
Checks if the interval has passed and resets the timer if true.
- Returns
- true if the interval has passed, false otherwise
Definition at line 186 of file metro.h.
◆ checkWithoutReset()
bool VolatileMetro::checkWithoutReset |
( |
| ) |
const volatile |
|
inline |
Checks if the interval has passed without resetting the timer.
- Returns
- true if the interval has passed, false otherwise
Definition at line 203 of file metro.h.
◆ interval()
void VolatileMetro::interval |
( |
unsigned long |
interval_millis | ) |
volatile |
|
inline |
Sets a new interval for the timer.
- Parameters
-
interval_millis | The new interval in milliseconds |
Definition at line 181 of file metro.h.
◆ reset()
void VolatileMetro::reset |
( |
| ) |
volatile |
|
inline |
Resets the timer to the current time.
Definition at line 212 of file metro.h.
The documentation for this class was generated from the following file: