53Q_DEFINE_THIS_MODULE(
"qf_ps")
58#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
59#error qpc version 7.0.0 or higher required
67enum_t QActive_maxPubSignal_;
78 QActive_subscrList_ = subscrSto;
79 QActive_maxPubSignal_ = maxSignal;
85 QF_bzero(subscrSto, (uint_fast16_t)maxSignal *
sizeof(
QSubscrList));
94 void const *
const sender,
95 uint_fast8_t
const qs_id)
127 QPSet subscrList = QActive_subscrList_[e->
sig];
130 if (QPSet_notEmpty(&subscrList)) {
132 uint_fast8_t p = QPSet_findMax(&subscrList);
133 QActive *a = QActive_registry_[p];
144 QPSet_remove(&subscrList, p);
145 if (QPSet_notEmpty(&subscrList)) {
147 p = QPSet_findMax(&subscrList);
148 a = QActive_registry_[p];
161 #if (QF_MAX_EPOOL > 0U)
170void QActive_subscribe(
QActive const *
const me,
173 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
176 && (sig < QActive_maxPubSignal_)
178 && (QActive_registry_[p] == me));
190 QPSet_insert(&QActive_subscrList_[sig], p);
199void QActive_unsubscribe(
QActive const *
const me,
202 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
205 && (sig < QActive_maxPubSignal_)
207 && (QActive_registry_[p] == me));
219 QPSet_remove(&QActive_subscrList_[sig], p);
228void QActive_unsubscribeAll(
QActive const *
const me) {
229 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
232 && (QActive_registry_[p] == me));
237 if (QPSet_hasElement(&QActive_subscrList_[sig], p)) {
238 QPSet_remove(&QActive_subscrList_[sig], p);
Customizable and memory-efficient Design by Contract (DbC) for embedded systems.
#define Q_REQUIRE_ID(id_, expr_)
#define Q_ASSERT_ID(id_, expr_)
#define Q_UNUSED_PAR(par_)
#define QACTIVE_POST(me_, e_, sender_)
#define QF_CRIT_EXIT_NOP()
Internal (package scope) QF/C interface.
QF/C sample port with all configurable options.
#define QF_SCHED_LOCK_(ceil_)
#define QF_SCHED_UNLOCK_()
@ QS_QF_ACTIVE_UNSUBSCRIBE
Internal (package scope) QS/C interface.
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_OBJ_PRE_(obj_)
#define QS_END_NOCRIT_PRE_()
#define QS_2U8_PRE_(data1_, data2_)
#define QS_SIG_PRE_(sig_)
QS/C sample port with all configurable options.
Active object class (based on the QHsm implementation strategy)
Priority Set of up to QF_MAX_ACTIVE elements.