89void QActive::start(std::uint_fast8_t const prio,
90 QEvt const * * const qSto, std::uint_fast16_t const qLen,
91 void * const stkSto, std::uint_fast16_t const stkSize,
92 void const * const par)
94 static_cast<void>(stkSto);
95 static_cast<void>(stkSize);
100 m_eQueue.init(qSto, qLen);
101 m_prio =
static_cast<std::uint8_t
>(prio);
105 this->
init(par, m_prio);
122 std::uint_fast8_t
const qs_id)
noexcept
124 static_cast<void>(e);
139 std::uint_fast8_t
const qs_id)
noexcept
156 QEvt const * *
const qSto, std::uint_fast16_t
const qLen,
157 void *
const stkSto, std::uint_fast16_t
const stkSize,
158 void const *
const par)
162 static_cast<void>(qSto);
163 static_cast<void>(qLen);
164 static_cast<void>(stkSto);
165 static_cast<void>(stkSize);
167 m_prio =
static_cast<std::uint8_t
>(prio);
176 std::uint_fast8_t
const qs_id)
noexcept
178 static_cast<void>(e);
179 static_cast<void>(qs_id);
194 std::uint_fast8_t
const qs_id)
noexcept
196 static_cast<void>(qs_id);
208 std::uint_fast16_t
const margin,
209 void const *
const sender)
noexcept
227 if (e->poolId_ != 0U) {
231 std::uint_fast8_t
const rec =
249 & (1U << (m_prio & 7U))) != 0U)
275 if (e->poolId_ != 0U) {
293 & (1U << (m_prio & 7U))) != 0U)
325 if (a->m_eQueue.isEmpty()) {
338 void const *
const sender)
noexcept
372 &
static_cast<std::uint8_t
>(~TE_IS_LINKED));
392 static_cast<void>(act->POST(t, sender));
419 if (t->
m_ctr == 0U) {
423 &
static_cast<std::uint8_t
>(~TE_IS_LINKED));
void start(std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par) override
Starts execution of an active object and registers the object with the framework.
void init(void const *const e, std::uint_fast8_t const qs_id) noexcept override
executes the top-most initial transition in QP::QHsm
void postLIFO(QEvt const *const e) noexcept override
Posts an event directly to the event queue of the active object using the Last-In-First-Out (LIFO) po...
bool post_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept override
void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id) noexcept override
Dispatches an event to QHsm.
QActive active object class (based on QP::QHsm implementation strategy)
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
virtual void postLIFO(QEvt const *const e) noexcept
Posts an event directly to the event queue of the active object using the Last-In-First-Out (LIFO) po...
virtual bool post_(QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
void stop(void)
Stops execution of an active object and removes it from the framework's supervision.
QEvt const * get_(void) noexcept
Get an event from the event queue of an active object.
static void init(void)
QF initialization.
static void onCleanup(void)
Cleanup QF callback.
static int_t run(void)
Transfers control to QF to run the application.
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
heads of linked lists of time events, one for every clock tick rate
static void gc(QEvt const *const e) noexcept
Recycle a dynamic event.
static void bzero(void *const start, std::uint_fast16_t const len) noexcept
Clear a specified region of memory to zero.
static void add_(QActive *const a) noexcept
Register an active object to be managed by the framework.
static void stop(void)
Function invoked by the application layer to stop the QF application and return control to the OS/Ker...
static QActive * active_[QF_MAX_ACTIVE+1U]
Internal array of registered active objects.
static void remove_(QActive *const a) noexcept
Remove the active object from the framework.
void init(void const *const e, std::uint_fast8_t const qs_id) noexcept override
executes the top-most initial transition in QP::QHsm
void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id) noexcept override
Dispatches an event to QHsm.
Hierarchical State Machine base class.
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id)
Dispatches an event to QHsm.
static void test_pause_(void)
internal function to pause test and enter the test event loop
static void onTestLoop(void)
callback to run the test loop
static void onFlush(void)
Callback to flush the QS trace data to the host.
static void beginRec_(std::uint_fast8_t const rec) noexcept
Mark the begin of a QS record rec
@ TE_OBJ
time event object
static void onReset(void)
callback function to reset the Target (to be implemented in the BSP)
static void endRec_(void) noexcept
Mark the end of a QS record rec
static void processTestEvts_(void)
internal function to process posted events during test
static void onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
static void tickX_(std::uint_fast8_t const tickRate, void const *const sender) noexcept
internal function to process armed time events during test
Time Event class (inherits QP:QEvt)
QTimeEvtCtr volatile m_ctr
the internal down-counter of the time event
QTimeEvt * toTimeEvt(void) noexcept
encapsulate the cast the m_act attribute to QTimeEvt*
QTimeEvtCtr m_interval
the interval for the periodic time event (zero for the one-shot time event)
QTimeEvt *volatile m_next
link to the next time event in the list
void *volatile m_act
the active object that receives the time events
namespace associated with the QP/C++ framework
std::uint_fast16_t const QF_NO_MARGIN
special value of margin that causes asserting failure in case event allocation or event posting fails
@ QS_ASSERT_FAIL
assertion failed in the code
@ QS_QF_TIMEEVT_AUTO_DISARM
a time event expired and was disarmed
@ QS_QF_RUN
QF_run() was entered.
@ QS_QEP_STATE_INIT
an initial transition was taken in a state
@ QS_QF_ACTIVE_POST_LIFO
an event was posted (LIFO) directly to AO
@ QS_QF_TIMEEVT_POST
a time event posted itself directly to an AO
@ QS_QF_ACTIVE_POST_ATTEMPT
attempt to post an evt to AO failed
@ QS_QF_TICK
QP::QF::tickX() was called.
@ QS_QEP_DISPATCH
an event was dispatched (begin of RTC step)
@ QS_TEST_PAUSED
test has been paused
@ QS_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
enum_t QF_maxPubSignal_
the maximum published signal
std::uint_fast8_t QF_maxPool_
void * currObj[8]
current objects
QP::QPSet readySet
QUTEST ready-set of active objects.
QSubscrList * QF_subscrList_
the subscriber list array
void QF_EVT_REF_CTR_INC_(QEvt const *const e) noexcept
increment the refCtr_ of an event e
std::uint8_t volatile QF_intNest
Customizable and memory-efficient assertions for embedded systems.
#define Q_DEFINE_THIS_MODULE(name_)
#define Q_ASSERT_ID(id_, test_)
#define Q_REQUIRE_ID(id_, test_)
int int_t
alias for line numbers in assertions and return from QF::run()
#define QF_CRIT_EXIT_NOP()
No-operation for exiting a critical section.
Internal (package scope) QF/C++ interface.
#define QF_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define Q_ASSERT_CRIT_(id_, test_)
#define QF_CRIT_X_()
This is an internal macro for exiting a critical section.
#define QF_CRIT_E_()
This is an internal macro for entering a critical section.
#define QS_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define QS_TIME_PRE_()
Internal macro to output time stamp to a QS record.
#define QS_FUN_DICTIONARY(fun_)
Output function dictionary record.
#define QS_TEST_PROBE_DEF(fun_)
QS macro to define the Test-Probe for a given fun_.
#define QS_TEST_PROBE(code_)
QS macro to apply a Test-Probe.
#define QS_TEST_PROBE_ID(id_, code_)
QS macro to apply a Test-Probe.
Internal (package scope) QS/C++ interface.
#define QS_BEGIN_PRE_(rec_, qs_id_)
Internal QS macro to begin a predefined QS record with critical section.
#define QS_U8_PRE_(data_)
Internal QS macro to output an unformatted uint8_t data element.
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
Internal QS macro to begin a predefined QS record without critical section.
#define QS_OBJ_PRE_(obj_)
Internal QS macro to output object pointer data element.
#define QS_FUN_PRE_(fun_)
Internal QS macro to output an unformatted function pointer data element.
#define QS_TEC_PRE_(ctr_)
#define QS_END_NOCRIT_PRE_()
Internal QS macro to end a predefiend QS record without critical section.
#define QS_U16_PRE_(data_)
Internal QS macro to output an unformatted uint16_t data element.
#define QS_2U8_PRE_(data1_, data2_)
Internal QS macro to output 2 unformatted uint8_t data elements.
#define QS_EQC_PRE_(ctr_)
#define QS_STR_PRE_(msg_)
Internal QS macro to output a zero-terminated ASCII string data element.
#define QS_END_PRE_()
Internal QS macro to end a predefined QS record with critical section.
Q_NORETURN Q_onAssert(char const *const module, int_t const location)
QSignal sig
signal of the event instance
std::uint8_t volatile refCtr_
reference counter
void rmove(std::uint_fast8_t const n) noexcept
remove element n from the set, n = 1..64
bool notEmpty(void) const noexcept
Evaluates to true if the priority set is not empty.
std::uint_fast8_t findMax(void) const noexcept
find the maximum element in the set, returns zero if the set is empty