Skip to content

Class rb::Timers

ClassList > rb > Timers

Public Static Attributes

Type Name
constexpr uint16_t INVALID_ID = = 0

Public Functions

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

Public Static Functions

Type Name
void deleteFreeRtOsTimerTask ()
If you don't plan to use FreeRTOS SW timers, call this to free up 2KB of heap.
Timers & get ()

Public Static Attributes Documentation

variable INVALID_ID

constexpr uint16_t rb::Timers::INVALID_ID;

Public Functions Documentation

function cancel

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

function isOnTimerTask

bool rb::Timers::isOnTimerTask () const

function reset

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

function schedule

Schedule callback to fire after period (in millisecond).

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

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

Parameters:

  • period_ms is period in which will be the schedule callback fired
  • callback is a function which will be schedule with the set period.

Returns:

timer ID that you can use to cancel the timer.

function stop

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

Public Static Functions Documentation

function deleteFreeRtOsTimerTask

static void rb::Timers::deleteFreeRtOsTimerTask () 

function get

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

The documentation for this class was generated from the following file demo-projets/esp/RBCXTimers.h