RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
rb::Timers Class Reference

#include <RBControl_timers.hpp>

Public Member Functions

uint16_t schedule (uint32_t period_ms, std::function< bool()> callback)
 Schedule callback to fire after period (in millisecond). More...
 
bool reset (uint16_t id, uint32_t period_ms)
 
bool cancel (uint16_t id)
 

Static Public Member Functions

static void deleteFreeRtOsTimerTask ()
 If you don't plan to use FreeRTOS SW timers, call this to free up 2KB of heap. More...
 
static Timersget ()
 

Static Public Attributes

static constexpr uint16_t INVALID_ID = 0
 

Member Function Documentation

◆ cancel()

bool rb::Timers::cancel ( uint16_t  id)

◆ deleteFreeRtOsTimerTask()

void rb::Timers::deleteFreeRtOsTimerTask ( )
static

If you don't plan to use FreeRTOS SW timers, call this to free up 2KB of heap.

◆ get()

Timers & rb::Timers::get ( )
static

◆ reset()

bool rb::Timers::reset ( uint16_t  id,
uint32_t  period_ms 
)

◆ schedule()

uint16_t rb::Timers::schedule ( uint32_t  period_ms,
std::function< bool()>  callback 
)

Schedule callback to fire after period (in millisecond).

Return true from the callback to schedule periodically, false to not (singleshot timer).

Parameters
period_msis period in which will be the schedule callback fired
callbackis a function which will be schedule with the set period.
Returns
timer ID that you can use to cancel the timer.

Member Data Documentation

◆ INVALID_ID

constexpr uint16_t rb::Timers::INVALID_ID = 0
staticconstexpr

The documentation for this class was generated from the following files: