40Q_DEFINE_THIS_MODULE(
"qf_qact")
56 QHsm_ctor((
QHsm *)(me), initial);
65 &QHsm_getStateHandler_
67 me->super.vptr = &vtable;
79 if (me->
pthre == 0U) {
96 uint8_t prev_thre = me->
pthre;
97 uint8_t next_thre = me->
pthre;
99 for (uint8_t p = me->
prio - 1U; p > 0U; --p) {
115 (prev_thre <= me->
pthre) && (me->
pthre <= next_thre));
131 uint8_t
const p = me->
prio;
149 return (
QPrioSpec)((uint32_t)prio | ((uint32_t)pthre << 8U));
156 static uint8_t
const log2LUT[16] = {
157 0U, 1U, 2U, 2U, 3U, 3U, 3U, 3U,
158 4U, 4U, 4U, 4U, 4U, 4U, 4U, 4U
164#if (QF_MAX_ACTIVE > 16U)
171#if (QF_MAX_ACTIVE > 8U)
184 return (uint_fast8_t)(n + log2LUT[x]);
192#if (QF_MAX_ACTIVE > 32)
199#if (QF_MAX_ACTIVE <= 32U)
200 return (me->
bits0 == 0U);
202 return (me->
bits0 == 0U)
210#if (QF_MAX_ACTIVE <= 32U)
211 return (me->
bits0 != 0U);
213 return (me->
bits0 != 0U)
221#if (QF_MAX_ACTIVE <= 32U)
223 return ((uint_fast32_t)me->
bits0 & ((uint_fast32_t)1U << (n - 1U))) != 0U;
226 ? (((uint_fast32_t)me->
bits0 & ((uint_fast32_t)1U << (n - 1U))) != 0U)
233#if (QF_MAX_ACTIVE <= 32U)
236 | ((uint_fast32_t)1U << (n - 1U)));
240 | ((uint_fast32_t)1U << (n - 1U)));
250#if (QF_MAX_ACTIVE <= 32U)
253 & ~((uint_fast32_t)1U << (n - 1U)));
257 & ~((uint_fast32_t)1U << (n - 1U)));
267#if (QF_MAX_ACTIVE <= 32U)
269 return QF_LOG2(me->
bits0);
271 return (me->
bits1 != 0U)
272 ? (32U + QF_LOG2(me->
bits1))
273 : (QF_LOG2(me->
bits0));
QPrioSpec QF_prioSpec(uint8_t const prio, uint8_t const pthre)
Create a QPrioSpec object to specify priority of an AO or a thread.
#define Q_STATE_CAST(handler_)
Perform cast to QStateHandler.
uint32_t QPSetBits
Bitmask for the internal representation of QPSet elements.
QState(*) QStateHandler(void *const me, QEvt const *const e)
Pointer to a state-handler function \clearpage .
uint16_t QPrioSpec
Priority specification for Active Objects in QP.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
QP/C Framework in C internal (package-scope) interface.
Super-template of the QP/C port (port interface reference).
#define QF_CRIT_ENTRY()
Port-specific critical section entry.
#define QF_LOG2(n_)
Port-specific integer log-base-2 of a 32-bit bitmask.
#define QF_CRIT_EXIT()
Port-specific critical section exit.
#define QF_CRIT_STAT
Define the critical section status that was present before entering the critical section.
QS (QP/Spy software tracing) internal (package-scope) interface.
Super-template of the QS port.
QP Functional Safety (FuSa) Subsystem (fault detection).
#define Q_ASSERT_INCRIT(id_, expr_)
General-purpose assertion with user-specified ID number (in critical section).
#define Q_REQUIRE_INCRIT(id_, expr_)
Assertion for checking a precondition (in critical section).
Active Object class (based on the QHsm implementation strategy).
void QActive_unregister_(QActive *const me)
Un-register the active object from the framework.
void QActive_ctor(QActive *const me, QStateHandler const initial)
QActive constructor (abstract base class).
void QActive_register_(QActive *const me)
Register this active object to be managed by the framework.
QActive * QActive_registry_[QF_MAX_ACTIVE+1U]
Static (one per-class) array of registered active objects.
uint8_t prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
uint8_t pthre
Preemption-threshold [1..QF_MAX_ACTIVE] of this AO.
union QAsmAttr state
Current state (pointer to the current state-handler function) \clearpage .
Virtual table for the QAsm class.
Private attributes of the QF framework.
Hierarchical State Machine class (QHsm-style implementation strategy).
Set of Active Objects of up to QF_MAX_ACTIVE elements.
void QPSet_remove(QPSet *const me, uint_fast8_t const n)
Remove element n from the priority-set (n = 1..QF_MAX_ACTIVE).
bool QPSet_isEmpty(QPSet const *const me)
Find out whether the priority-set is empty.
bool QPSet_notEmpty(QPSet const *const me)
Find out whether the priority-set is NOT empty.
void QPSet_insert(QPSet *const me, uint_fast8_t const n)
Insert element n into the priority-set (n = 1..QF_MAX_ACTIVE).
void QPSet_setEmpty(QPSet *const me)
Make the priority set empty \clearpage .
bool QPSet_hasElement(QPSet const *const me, uint_fast8_t const n)
Find out whether the priority-set has element n.
QPSetBits bits0
Bitmask for elements 1..32 \clearpage .
QPSetBits bits1
Bitmask for elements 33..64 \clearpage .
uint_fast8_t QPSet_findMax(QPSet const *const me)
Find the maximum element in the (non-empty) priority-set.