ReactESP 1.0.0
Asynchronous programming for the ESP microcontrollers
|
TimedReactions are called based on elapsing of time. More...
#include <ReactESP.h>
Public Member Functions | |
TimedReaction (const uint32_t interval, const react_callback callback) | |
Construct a new Timed Reaction object. More... | |
TimedReaction (const uint64_t interval, const react_callback callback) | |
Construct a new Timed Reaction object. More... | |
virtual | ~TimedReaction () |
bool | operator< (const TimedReaction &other) |
Return the current time since the device restart in microseconds. More... | |
void | add () |
void | remove () |
uint32_t | getTriggerTime () |
uint64_t | getTriggerTimeMicros () |
bool | isEnabled () |
virtual void | tick ()=0 |
![]() | |
Reaction (react_callback callback) | |
Construct a new Reaction object. More... | |
Protected Attributes | |
const uint64_t | interval |
uint64_t | last_trigger_time |
bool | enabled |
![]() | |
const react_callback | callback |
TimedReactions are called based on elapsing of time.
Definition at line 45 of file ReactESP.h.
|
inline |
Construct a new Timed Reaction object.
interval | Interval or delay for the reaction, in milliseconds |
callback | Function to be called when the reaction is triggered |
Definition at line 58 of file ReactESP.h.
|
inline |
Construct a new Timed Reaction object.
interval | Interval, in microseconds |
callback | Function to be called when the reaction is triggered |
Definition at line 69 of file ReactESP.h.
|
inlinevirtual |
Definition at line 75 of file ReactESP.h.
|
virtual |
Implements Reaction.
Definition at line 26 of file ReactESP.cpp.
|
inline |
Definition at line 79 of file ReactESP.h.
|
inline |
Definition at line 80 of file ReactESP.h.
|
inline |
Definition at line 81 of file ReactESP.h.
bool TimedReaction::operator< | ( | const TimedReaction & | other | ) |
Return the current time since the device restart in microseconds.
Returns the time since the device restart. Even though the time is in microseconds, a 64-bit integer is all but guaranteed not to rewrap, ever.
Definition at line 21 of file ReactESP.cpp.
|
virtual |
Implements Reaction.
Definition at line 28 of file ReactESP.cpp.
|
pure virtual |
Implements Reaction.
Implemented in DelayReaction, and RepeatReaction.
|
protected |
Definition at line 49 of file ReactESP.h.
|
protected |
Definition at line 47 of file ReactESP.h.
|
protected |
Definition at line 48 of file ReactESP.h.