29#ifndef ETL_CALLBACK_TIMER_DEFERRED_LOCKED_INCLUDED
30#define ETL_CALLBACK_TIMER_DEFERRED_LOCKED_INCLUDED
32#include "callback_timer_locked.h"
43 template <u
int_least8_t MAX_TIMERS_, u
int32_t MAX_HANDLERS_>
48 ETL_STATIC_ASSERT(
MAX_TIMERS_ <= 254U,
"No more than 254 timers are allowed");
65 bool operator < (
const CallbackNode& p)
const
67 return this->priority > p.priority;
106 while (
has_active && (count >= active_list.front().delta))
110 count -=
timer.delta;
112 active_list.remove(
timer.
id,
true);
114 if (
timer.callback.is_valid())
116 if (!handler_queue.
full())
118 handler_queue.
push(CallbackNode(
timer.callback, timer_priorities[
timer.
id]));
135 active_list.front().delta -= count;
161 if (handler_queue.
empty())
203 if (
id != etl::timer::id::NO_TIMER)
The deferred callback timer.
Definition callback_timer_deferred_locked.h:45
etl::timer::id::type register_timer(const callback_type &callback_, uint32_t period_, bool repeating_, uint_least8_t priority_)
Definition callback_timer_deferred_locked.h:196
callback_timer_deferred_locked(try_lock_type try_lock_, lock_type lock_, unlock_type unlock_)
Constructor.
Definition callback_timer_deferred_locked.h:86
void handle_deferred(void)
Definition callback_timer_deferred_locked.h:153
callback_timer_deferred_locked()
Constructor.
Definition callback_timer_deferred_locked.h:78
bool tick(uint32_t count) final
Handle the tick call.
Definition callback_timer_deferred_locked.h:95
etl::timer::id::type register_timer(const callback_type &callback_, uint32_t period_, bool repeating_)
Register a timer.
Definition callback_timer_deferred_locked.h:183
Interface for callback timer.
Definition callback_timer_locked.h:49
void set_locks(try_lock_type try_lock_, lock_type lock_, lock_type unlock_)
Sets the lock and unlock delegates.
Definition callback_timer_locked.h:257
etl::timer::id::type register_timer(const callback_type &callback_, uint32_t period_, bool repeating_)
Register a timer.
Definition callback_timer_locked.h:60
Definition priority_queue.h:461
bool full() const
Definition priority_queue.h:359
bool empty() const
Definition priority_queue.h:350
void push(const_reference value)
Definition priority_queue.h:154
reference top()
Definition priority_queue.h:134
void pop()
Definition priority_queue.h:312
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
The configuration of a timer.
Definition callback_timer_locked.h:327
Common definitions for the timer framework.
Definition timer.h:55