40#ifndef QF_EVENT_SIZ_SIZE
42 #define QF_EVENT_SIZ_SIZE 2U
44#if (QF_EVENT_SIZ_SIZE == 1U)
46#elif (QF_EVENT_SIZ_SIZE == 2U)
53#elif (QF_EVENT_SIZ_SIZE == 4U)
56 #error "QF_EVENT_SIZ_SIZE defined incorrectly, expected 1, 2, or 4"
61 #define QF_MAX_EPOOL 3U
64#ifndef QF_MAX_TICK_RATE
68 #define QF_MAX_TICK_RATE 1U
69#elif (QF_MAX_TICK_RATE > 15U)
70 #error "QF_MAX_TICK_RATE exceeds the maximum of 15"
73#ifndef QF_TIMEEVT_CTR_SIZE
77 #define QF_TIMEEVT_CTR_SIZE 2U
125#ifdef QF_OS_OBJECT_TYPE
163 void (*start)(
QActive *
const me, uint_fast8_t prio,
164 QEvt const * *
const qSto, uint_fast16_t
const qLen,
165 void *
const stkSto, uint_fast16_t
const stkSize,
166 void const *
const par);
174 uint_fast16_t
const margin,
void const *
const sender);
176 bool (*post)(
QActive *
const me,
QEvt const *
const e,
177 uint_fast16_t
const margin);
206#define QACTIVE_START(me_, prio_, qSto_, qLen_, stkSto_, stkLen_, par_) do { \
207 Q_ASSERT((Q_HSM_UPCAST(me_))->vptr); \
208 (*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->start)( \
209 (QActive *)(me_), (prio_), \
210 (qSto_), (qLen_), (stkSto_), (stkLen_), (par_)); \
238 #define QACTIVE_POST(me_, e_, sender_) \
239 ((void)(*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->post)(\
240 (me_), (e_), QF_NO_MARGIN, (sender_)))
275 #define QACTIVE_POST_X(me_, e_, margin_, sender_) \
276 ((*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->post)((me_),\
277 (e_), (margin_), (sender_)))
280 #define QACTIVE_POST(me_, e_, sender_) \
281 ((void)(*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->post)(\
282 (me_), (e_), QF_NO_MARGIN))
284 #define QACTIVE_POST_X(me_, e_, margin_, sender_) \
285 ((*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->post)( \
286 (me_), (e_), (margin_)))
295#define QACTIVE_POST_LIFO(me_, e_) \
296 ((*((QActiveVtable const *)((Q_HSM_UPCAST(me_))->vptr))->postLIFO)( \
396#if (QF_TIMEEVT_CTR_SIZE == 1U)
398#elif (QF_TIMEEVT_CTR_SIZE == 2U)
410#elif (QF_TIMEEVT_CTR_SIZE == 4U)
413 #error "QF_TIMEEVT_CTR_SIZE defined incorrectly, expected 1, 2, or 4"
489 enum_t const sig, uint_fast8_t tickRate);
553void QF_poolInit(
void *
const poolSto, uint_fast32_t
const poolSize,
554 uint_fast16_t
const evtSize);
603 void const *
const sender, uint_fast8_t
const qs_id);
626 #define QF_PUBLISH(e_, sender_) \
627 (QF_publish_((e_), (void const *)(sender_), (sender_)->prio))
632 #define QF_PUBLISH(e_, dummy_) (QF_publish_(e_))
641 void QF_tickX_(uint_fast8_t
const tickRate,
void const *
const sender);
675 #define QF_TICK_X(tickRate_, sender_) (QF_tickX_((tickRate_), (sender_)))
679 void QF_tickX_(uint_fast8_t
const tickRate);
680 #define QF_TICK_X(tickRate_, dummy) (QF_tickX_(tickRate_))
687#define QF_NO_MARGIN ((uint_fast16_t)0xFFFFU)
692#define QF_TICK(sender_) QF_TICK_X(0U, (sender_))
724 uint_fast16_t
const margin,
enum_t const sig);
738 #define Q_NEW(evtT_, sig_, ...) \
739 (evtT_##_ctor((evtT_ *)QF_newX_((uint_fast16_t)sizeof(evtT_), \
740 QF_NO_MARGIN, 0), (enum_t)(sig_), ##__VA_ARGS__))
742 #define Q_NEW_X(e_, evtT_, margin_, sig_, ...) do { \
743 (e_) = (evtT_ *)QF_newX_((uint_fast16_t)sizeof(evtT_), \
745 if ((e_) != (evtT_ *)0) { \
746 evtT_##_ctor((e_), (enum_t)(sig_), ##__VA_ARGS__); \
773 #define Q_NEW(evtT_, sig_) \
774 ((evtT_ *)QF_newX_((uint_fast16_t)sizeof(evtT_), \
775 QF_NO_MARGIN, (enum_t)(sig_)))
803 #define Q_NEW_X(e_, evtT_, margin_, sig_) ((e_) = \
804 (evtT_ *)QF_newX_((uint_fast16_t)sizeof(evtT_), \
805 (margin_), (enum_t)(sig_)))
828#define Q_NEW_REF(evtRef_, evtT_) \
829 ((evtRef_) = (evtT_ const *)QF_newRef_(e, (evtRef_)))
845#define Q_DELETE_REF(evtRef_) do { \
846 QF_deleteRef_((evtRef_)); \
847 (evtRef_) = (void *)0; \
858void QF_bzero(
void *
const start, uint_fast16_t len);
860#ifndef QF_CRIT_EXIT_NOP
871 #define QF_CRIT_EXIT_NOP() ((void)0)
#define QF_OS_OBJECT_TYPE
QState(* QStateHandler)(void *const me, QEvt const *const e)
QActiveVtable QMActiveVtable
QP native, platform-independent priority sets of 32 or 64 elements.
void QActive_unsubscribe(QActive const *const me, enum_t const sig)
void QActive_ctor(QActive *const me, QStateHandler initial)
bool QActive_recall(QActive *const me, QEQueue *const eq)
void QActive_setAttr(QActive *const me, uint32_t attr1, void const *attr2)
bool QActive_defer(QActive const *const me, QEQueue *const eq, QEvt const *const e)
void QActive_stop(QActive *const me)
uint_fast16_t QActive_flushDeferred(QActive const *const me, QEQueue *const eq)
void QActive_subscribe(QActive const *const me, enum_t const sig)
void QActive_unsubscribeAll(QActive const *const me)
void QF_poolInit(void *const poolSto, uint_fast32_t const poolSize, uint_fast16_t const evtSize)
void QF_bzero(void *const start, uint_fast16_t len)
uint_fast16_t QF_getQueueMin(uint_fast8_t const prio)
void QF_remove_(QActive *const a)
void QF_psInit(QSubscrList *const subscrSto, enum_t const maxSignal)
void QF_add_(QActive *const a)
bool QF_noTimeEvtsActiveX(uint_fast8_t const tickRate)
QActive * QF_active_[QF_MAX_ACTIVE+1U]
void QF_publish_(QEvt const *const e, void const *const sender, uint_fast8_t const qs_id)
void QF_gc(QEvt const *const e)
uint_fast16_t QF_poolGetMaxBlockSize(void)
void QF_tickX_(uint_fast8_t const tickRate, void const *const sender)
QEvt * QF_newX_(uint_fast16_t const evtSize, uint_fast16_t const margin, enum_t const sig)
uint_fast16_t QF_getPoolMin(uint_fast8_t const poolId)
void QF_deleteRef_(void const *const evtRef)
QEvt const * QF_newRef_(QEvt const *const e, void const *const evtRef)
void QMActive_ctor(QMActive *const me, QStateHandler initial)
void QTicker_ctor(QTicker *const me, uint_fast8_t tickRate)
struct QTimeEvt *volatile next
bool QTimeEvt_rearm(QTimeEvt *const me, QTimeEvtCtr const nTicks)
QTimeEvtCtr QTimeEvt_currCtr(QTimeEvt const *const me)
void QTimeEvt_ctorX(QTimeEvt *const me, QActive *const act, enum_t const sig, uint_fast8_t tickRate)
bool QTimeEvt_wasDisarmed(QTimeEvt *const me)
void QTimeEvt_armX(QTimeEvt *const me, QTimeEvtCtr const nTicks, QTimeEvtCtr const interval)
bool QTimeEvt_disarm(QTimeEvt *const me)