51#ifndef QF_TIMEEVT_CTR_SIZE
55 #define QF_TIMEEVT_CTR_SIZE 0U
57#if (QF_TIMEEVT_CTR_SIZE == 0U)
59#elif (QF_TIMEEVT_CTR_SIZE == 1U)
61#elif (QF_TIMEEVT_CTR_SIZE == 2U)
76#elif (QF_TIMEEVT_CTR_SIZE == 4U)
79 #error "QF_TIMER_SIZE defined incorrectly, expected 1U, 2U, or 4U"
82#if (QF_TIMEEVT_CTR_SIZE != 0U)
86#ifdef QF_TIMEEVT_PERIODIC
92#ifndef QF_MAX_TICK_RATE
94 #define QF_MAX_TICK_RATE 1U
95#elif (QF_MAX_TICK_RATE > 4U)
96 #error "QF_MAX_TICK_RATE exceeds the 4U limit"
125#if (QF_TIMEEVT_CTR_SIZE != 0U)
152#if (Q_PARAM_SIZE != 0U)
157 bool (*post)(
QActive *
const me, uint_fast8_t
const margin,
164 bool (*postISR)(
QActive *
const me, uint_fast8_t
const margin,
167 bool (*post) (
QActive *
const me, uint_fast8_t
const margin,
169 bool (*postISR)(
QActive *
const me, uint_fast8_t
const margin,
181#define QF_NO_MARGIN ((uint_fast8_t)0xFF)
183#if (Q_PARAM_SIZE != 0U)
201 #define QACTIVE_POST(me_, sig_, par_) do { \
202 QActive * const ao_ = QF_ACTIVE_CAST((me_)); \
203 ((void)(*((QActiveVtable const *)(ao_->super.vptr))->post)( \
204 ao_, QF_NO_MARGIN, (enum_t)(sig_), (QParam)(par_)));\
230 #define QACTIVE_POST_X(me_, margin_, sig_, par_) \
231 ((*((QActiveVtable const *)((me_)->super.vptr))->post)( \
232 (me_), (margin_), (enum_t)(sig_), (QParam)(par_)))
250 #define QACTIVE_POST_ISR(me_, sig_, par_) do { \
251 QActive * const ao_ = QF_ACTIVE_CAST((me_)); \
252 ((void)(*((QActiveVtable const *)(ao_->super.vptr))->postISR)( \
253 ao_, QF_NO_MARGIN, (enum_t)(sig_), (QParam)(par_))); \
279 #define QACTIVE_POST_X_ISR(me_, margin_, sig_, par_) \
280 ((*((QActiveVtable const *)( \
281 QF_ACTIVE_CAST((me_))->super.vptr))->postISR)( \
282 QF_ACTIVE_CAST((me_)), (margin_), \
283 (enum_t)(sig_), (QParam)(par_)))
299 #define QACTIVE_POST(me_, sig_) do { \
300 QActive * const ao_ = QF_ACTIVE_CAST((me_)); \
301 ((void)(*((QActiveVtable const *)(ao_->super.vptr))->post)( \
302 ao_, QF_NO_MARGIN, (enum_t)(sig_))); \
305 #define QACTIVE_POST_X(me_, margin_, sig_) \
306 ((*((QActiveVtable const *)((me_)->super.vptr))->post)((me_), \
312 #define QACTIVE_POST_ISR(me_, sig_) do { \
313 QActive * const ao_ = QF_ACTIVE_CAST((me_)); \
314 ((void)(*((QActiveVtable const *)(ao_->super.vptr))->postISR)( \
315 ao_, QF_NO_MARGIN, (enum_t)(sig_))); \
318 #define QACTIVE_POST_X_ISR(me_, margin_, sig_) \
319 ((*((QActiveVtable const *)( \
320 QF_ACTIVE_CAST((me_))->super.vptr))->postISR)( \
321 QF_ACTIVE_CAST((me_)), (margin_), (enum_t)(sig_)))
327#if (QF_TIMEEVT_CTR_SIZE != 0U)
332#ifdef QF_TIMEEVT_PERIODIC
358void QF_init(uint_fast8_t maxActive);
425#ifdef QF_TIMEEVT_USAGE
442#define QF_ROM_QUEUE_AT_(ao_, i_) (((QEvt *)Q_ROM_PTR((ao_)->queue))[(i_)])
448#define QF_ROM_ACTIVE_GET_(p_) ((QActive *)Q_ROM_PTR(QF_active[(p_)].act))
456#define QF_ACTIVE_CAST(a_) ((QActive *)(a_))
QState(* QStateHandler)(void *const me)
QActiveCB const Q_ROM QF_active[]
active object control blocks
void QF_init(uint_fast8_t maxActive)
uint_fast8_t volatile QF_readySet_
uint_fast8_t QF_maxActive_
void QF_tickXISR(uint_fast8_t const tickRate)
uint8_t const Q_ROM QF_log2Lkup[16]
uint_fast8_t volatile QF_timerSetX_[QF_MAX_TICK_RATE]
uint8_t const Q_ROM QF_invPow2Lkup[9]
void QActive_ctor(QActive *const me, QStateHandler initial)
QHsm super
derives from the QHsm base class
bool QActive_postX_(QActive *const me, uint_fast8_t margin, enum_t const sig, QParam const par)
void QActive_disarmX(QActive *const me, uint_fast8_t const tickRate)
void QActive_armX(QActive *const me, uint_fast8_t const tickRate, QTimeEvtCtr const nTicks, QTimeEvtCtr const interval)
QTimer tickCtr[QF_MAX_TICK_RATE]
bool QActive_postXISR_(QActive *const me, uint_fast8_t margin, enum_t const sig, QParam const par)