34 uint16_t
schedule(uint32_t period_ms, std::function<
bool()> callback);
41 bool reset(uint16_t
id, uint32_t period_ms);
55 bool stop(uint16_t
id);
62 std::function<bool()> callback;
63 esp_timer_handle_t handle;
66 void swap(timer_t& o) {
67 callback.swap(o.callback);
68 std::swap(handle, o.handle);
73 static void timerCallback(
void* handleVoid);
78 void cancelByIdxLocked(
size_t idx);
79 uint16_t getFreeIdLocked();
81 std::vector<timer_t> m_timers;
82 std::recursive_mutex m_mutex;
83 uint16_t m_id_counter;
Definition: RBCXTimers.h:14
bool reset(uint16_t id, uint32_t period_ms)
Reset the timer with the given ID.
Definition: RBCXTimers.cpp:70
bool cancel(uint16_t id)
Cancel the timer with the given ID.
Definition: RBCXTimers.cpp:84
static void deleteFreeRtOsTimerTask()
If you don't plan to use FreeRTOS SW timers, call this to free up 2KB of heap.
Definition: RBCXTimers.cpp:14
uint16_t schedule(uint32_t period_ms, std::function< bool()> callback)
Schedule callback to fire after period (in millisecond).
Definition: RBCXTimers.cpp:44
static Timers & get()
Definition: RBCXTimers.cpp:19
static constexpr uint16_t INVALID_ID
Definition: RBCXTimers.h:16
bool isOnTimerTask() const
Definition: RBCXTimers.cpp:145
bool stop(uint16_t id)
Stop the timer with the given ID.
Definition: RBCXTimers.cpp:97
Definition: RBCXAngle.cpp:3