54Q_DEFINE_THIS_MODULE(
"qf_ps")
58#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
59#error qpc version 7.3.0 or higher required
67enum_t QActive_maxPubSignal_;
78 QActive_subscrList_ = subscrSto;
79 QActive_maxPubSignal_ = maxSignal;
82 for (
enum_t sig = 0; sig < maxSignal; ++sig) {
83 QPSet_setEmpty(&subscrSto[sig].set);
85 QPSet_update_(&subscrSto[sig].set, &subscrSto[sig].set_dis);
97 void const *
const sender,
98 uint_fast8_t
const qsId)
113 QPSet_verify_(&QActive_subscrList_[sig].set,
114 &QActive_subscrList_[sig].set_dis));
120 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
124 if (QEvt_getPoolNum_(e) != 0U) {
135 QPSet subscrSet = QActive_subscrList_[sig].set;
140 if (QPSet_notEmpty(&subscrSet)) {
142 uint_fast8_t p = QPSet_findMax(&subscrSet);
147 QActive *a = QActive_registry_[p];
163 QPSet_remove(&subscrSet, p);
164 if (QPSet_notEmpty(&subscrSet)) {
165 p = QPSet_findMax(&subscrSet);
170 a = QActive_registry_[p];
180 }
while ((p != 0U) && (lbound > 0U));
194 #if (QF_MAX_EPOOL > 0U)
204void QActive_subscribe(
QActive const *
const me,
207 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
214 && (sig < QActive_maxPubSignal_)
216 && (QActive_registry_[p] == me));
218 QPSet_verify_(&QActive_subscrList_[sig].set,
219 &QActive_subscrList_[sig].set_dis));
228 QPSet_insert(&QActive_subscrList_[sig].set, p);
230 QPSet_update_(&QActive_subscrList_[sig].set,
231 &QActive_subscrList_[sig].set_dis);
243void QActive_unsubscribe(
QActive const *
const me,
246 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
253 && (sig < QActive_maxPubSignal_)
255 && (QActive_registry_[p] == me));
257 QPSet_verify_(&QActive_subscrList_[sig].set,
258 &QActive_subscrList_[sig].set_dis));
267 QPSet_remove(&QActive_subscrList_[sig].set, p);
269 QPSet_update_(&QActive_subscrList_[sig].set,
270 &QActive_subscrList_[sig].set_dis);
282void QActive_unsubscribeAll(
QActive const *
const me) {
287 uint_fast8_t
const p = (uint_fast8_t)me->
prio;
290 && (QActive_registry_[p] == me));
291 enum_t const maxPubSig = QActive_maxPubSignal_;
300 if (QPSet_hasElement(&QActive_subscrList_[sig].set, p)) {
301 QPSet_remove(&QActive_subscrList_[sig].set, p);
303 QPSet_update_(&QActive_subscrList_[sig].set,
304 &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.
@ 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.
@ QS_QF_PUBLISH
an event was published to active objects
@ QS_QF_ACTIVE_UNSUBSCRIBE
an AO unsubscribed to an event
@ QS_QF_ACTIVE_SUBSCRIBE
an AO subscribed to an event
QS/C package-scope interface.
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_
Reference counter (for mutable events and 0 for immutable (static) events)
Set of Active Objects of up to QF_MAX_ACTIVE elements.
Subscriber List (for publish-subscribe)