54Q_DEFINE_THIS_MODULE(
"qf_actq")
59#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
60#error qpc version 7.3.0 or higher required
67bool QActive_post_(
QActive *
const me,
69 uint_fast16_t
const margin,
70 void const *
const sender)
79 return QActiveDummy_fakePost_(me, e, margin, sender);
91 uint8_t
const pcopy = (uint8_t)(~me->
prio_dis);
121 if (QEvt_getPoolNum_(e) != 0U) {
129 if (me->
eQueue.nMin > nFree) {
138 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->refCtr_);
140 QS_EQC_PRE_(me->eQueue.nMin);
151 QS_onTestPost(sender, me, e, status);
158 if (me->eQueue.frontEvt == (
QEvt *)0) {
159 me->eQueue.frontEvt = e;
162 if (me->super.state.act == Q_ACTION_CAST(0)) {
163 QXTHREAD_EQUEUE_SIGNAL_(me);
166 QACTIVE_EQUEUE_SIGNAL_(me);
175 me->eQueue.ring[me->eQueue.head] = e;
177 if (me->eQueue.head == 0U) {
178 me->eQueue.head = me->eQueue.end;
193 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->refCtr_);
206 QS_onTestPost(sender, me, e, status);
216 #if (QF_MAX_EPOOL > 0U)
229 QEvt const *
const e)
234 QActiveDummy_fakePostLIFO_(me, e);
247 uint8_t
const pcopy = (uint8_t)(~me->
prio_dis);
265 if (QEvt_getPoolNum_(e) != 0U) {
271 if (me->
eQueue.nMin > nFree) {
279 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
281 QS_EQC_PRE_(me->
eQueue.nMin);
292 QS_onTestPost((
QActive *)0, me, e,
true);
299 QEvt const *
const frontEvt = me->
eQueue.frontEvt;
302 if (frontEvt == (
QEvt *)0) {
336 if (nFree <= me->eQueue.end) {
339 if (me->
eQueue.tail == 0U) {
348 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
362 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
377uint_fast16_t QF_getQueueMin(uint_fast8_t
const prio) {
381 && (QActive_registry_[prio] != (
QActive *)0));
382 uint_fast16_t
const min =
383 (uint_fast16_t)QActive_registry_[prio]->eQueue.nMin;
396 uint_fast8_t
const tickRate)
405 ,&QHsm_getStateHandler_
418 void const *
const par,
419 uint_fast8_t
const qsId)
437void QTicker_dispatch_(
439 QEvt const *
const e,
440 uint_fast8_t
const qsId)
455 for (; nTicks > 0U; --nTicks) {
456 QTimeEvt_tick_((uint_fast8_t)
QACTIVE_CAST_(me)->eQueue.head, me);
464 void const *
const sender)
477 me->
eQueue.frontEvt = &tickEvt;
#define QACTIVE_EQUEUE_SIGNAL_(me_)
#define QACTIVE_EQUEUE_WAIT_(me_)
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define QF_NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
#define Q_STATE_CAST(handler_)
Perform cast to QStateHandler.
#define Q_ACTION_CAST(action_)
Perform cast to QActionHandler.
#define QEVT_INITIALIZER(sig_)
Initializer for immutable (constant) QEvt instances.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64)
Internal (package scope) QP/C interface.
#define QACTIVE_CAST_(ptr_)
@ QS_QF_ACTIVE_POST_LIFO
an event was posted (LIFO) directly to AO
@ QS_QF_ACTIVE_GET
AO got an event and its queue is not empty.
@ QS_QF_ACTIVE_POST_ATTEMPT
attempt to post an evt to AO failed
#define QS_TEST_PROBE_DEF(fun_)
@ QS_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
#define QS_TEST_PROBE_ID(id_, code_)
@ QS_QF_ACTIVE_GET_LAST
AO got an event and its queue is empty.
#define QS_LOC_CHECK_(qsId_)
QS/C package-scope interface.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_INVARIANT_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
#define Q_ERROR_INCRIT(id_)
Active object class (based on the QHsm implementation strategy)
QACTIVE_EQUEUE_TYPE eQueue
Port-dependent event-queue type (often QEQueue)
uint8_t prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
Abstract State Machine class (state machine interface)
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also Object Orientation)
union QAsmAttr state
Current state (pointer to the current state-handler function)
union QAsmAttr temp
Temporary storage for target/act-table etc.
Virtual table for the QAsm class.
QSignal sig
Signal of the event (see Event Signal)
uint8_t volatile refCtr_
Reference counter (for mutable events and 0 for immutable (static) events)
"Ticker" Active Object class