46Q_DEFINE_THIS_MODULE(
"qf_ps")
50#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
51#error qpc version 7.3.0 or higher required
59enum_t QActive_maxPubSignal_;
70 QActive_subscrList_ = subscrSto;
71 QActive_maxPubSignal_ = maxSignal;
74 for (
enum_t sig = 0; sig < maxSignal; ++sig) {
75 QPSet_setEmpty(&subscrSto[sig].set);
77 QPSet_update_(&subscrSto[sig].set, &subscrSto[sig].set_dis);
89 void const *
const sender,
90 uint_fast8_t
const qsId)
105 QPSet_verify_(&QActive_subscrList_[sig].set,
106 &QActive_subscrList_[sig].set_dis));
116 if (QEvt_getPoolNum_(e) != 0U) {
127 QPSet subscrSet = QActive_subscrList_[sig].set;
132 if (QPSet_notEmpty(&subscrSet)) {
134 uint_fast8_t p = QPSet_findMax(&subscrSet);
139 QActive *a = QActive_registry_[p];
155 QPSet_remove(&subscrSet, p);
156 if (QPSet_notEmpty(&subscrSet)) {
157 p = QPSet_findMax(&subscrSet);
162 a = QActive_registry_[p];
172 }
while ((p != 0U) && (lbound > 0U));
186 #if (QF_MAX_EPOOL > 0U)
196void QActive_subscribe(
QActive const *
const me,
199 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
206 && (sig < QActive_maxPubSignal_)
208 && (QActive_registry_[p] == me));
210 QPSet_verify_(&QActive_subscrList_[sig].set,
211 &QActive_subscrList_[sig].set_dis));
220 QPSet_insert(&QActive_subscrList_[sig].set, p);
222 QPSet_update_(&QActive_subscrList_[sig].set,
223 &QActive_subscrList_[sig].set_dis);
235void QActive_unsubscribe(
QActive const *
const me,
238 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
245 && (sig < QActive_maxPubSignal_)
247 && (QActive_registry_[p] == me));
249 QPSet_verify_(&QActive_subscrList_[sig].set,
250 &QActive_subscrList_[sig].set_dis));
259 QPSet_remove(&QActive_subscrList_[sig].set, p);
261 QPSet_update_(&QActive_subscrList_[sig].set,
262 &QActive_subscrList_[sig].set_dis);
274void QActive_unsubscribeAll(
QActive const *
const me) {
279 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
282 && (QActive_registry_[p] == me));
283 enum_t const maxPubSig = QActive_maxPubSignal_;
292 if (QPSet_hasElement(&QActive_subscrList_[sig].set, p)) {
293 QPSet_remove(&QActive_subscrList_[sig].set, p);
295 QPSet_update_(&QActive_subscrList_[sig].set,
296 &QActive_subscrList_[sig].set_dis);
#define QF_SCHED_LOCK_(ceil_)
#define QF_SCHED_UNLOCK_()
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define Q_USER_SIG
offset for the user signals (QP Application))
#define QACTIVE_POST(me_, e_, sender_)
Invoke the direct event posting facility QActive_post_().
#define QF_CRIT_EXIT_NOP()
No-operation for exiting a critical section.
uint16_t QSignal
The signal of event QEvt.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64)
Internal (package scope) QP/C interface.
#define QS_2U8_PRE(data1_, data2_)
#define QS_BEGIN_PRE(rec_, qsId_)
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_INVARIANT_INCRIT(id_, expr_)
#define Q_ENSURE_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
Active object class (based on the QHsm implementation strategy)
uint8_t prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
QSignal sig
Signal of the event (see Event Signal)
uint8_t volatile refCtr_
Event reference counter.
Set of Active Objects of up to QF_MAX_ACTIVE elements.
Subscriber List (for publish-subscribe)