43 #include "qf_port.hpp"
66 bzero(&active_[0],
sizeof(active_));
94 void const * const par)
96 static_cast<void>(stkSto);
97 static_cast<void>(stkSize);
102 m_eQueue.init(qSto, qLen);
107 this->
init(par, m_prio);
111 #ifdef QF_ACTIVE_STOP
126 void const *
const par)
130 static_cast<void>(qSto);
131 static_cast<void>(qLen);
132 static_cast<void>(stkSto);
133 static_cast<void>(stkSize);
146 static_cast<void>(e);
147 static_cast<void>(qs_id);
160 static_cast<void>(e);
161 static_cast<void>(qs_id);
174 void const *
const sender) noexcept
192 if (e->poolId_ != 0U) {
214 & (1U << (m_prio & 7U))) != 0U)
240 if (e->poolId_ != 0U) {
258 & (1U << (m_prio & 7U))) != 0U)
290 if (a->m_eQueue.isEmpty()) {
303 void const *
const sender) noexcept
357 static_cast<void>(act->POST(t, sender));
384 if (t->
m_ctr == 0U) {
unsigned int uint_fast16_t
fast at-least 16-bit unsigned int
unsigned char uint8_t
exact-width 8-bit unsigned int
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
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 (based on QP::QHsm implementation)
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 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]
array of registered active objects
static void remove_(QActive *const a) noexcept
Remove the active object from the framework.
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id)
Dispatches an event to QHsm.
void * currObj[MAX_OBJ]
current objects
static struct QP::QS::QSrxPriv rxPriv_
static void onTestLoop(void)
callback to run the test loop
static void onFlush(void)
Callback to flush the QS trace data to the host.
@ TE_OBJ
time event object
static void onReset(void)
callback function to reset the Target (to be implemented in the BSP)
static void processTestEvts_(void)
internal function to process posted events during test
QP::QPSet readySet
QUTEST ready-set of active objects.
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
QTimeEvt * toTimeEvt(void) noexcept
encapsulate the cast the m_act attribute to QTimeEvt*
QTimeEvtCtr volatile m_ctr
the internal down-counter of the time event.
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_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
void QF_EVT_REF_CTR_INC_(QEvt const *const e) noexcept
increment the refCtr_ of an event e
enum_t QF_maxPubSignal_
the maximum published signal
constexpr std::uint8_t TE_IS_LINKED
std::uint_fast8_t QF_maxPool_
QSubscrList * QF_subscrList_
the subscriber list array
std::uint8_t volatile QF_intNest
Customizable and memory-efficient assertions for embedded systems.
#define Q_DEFINE_THIS_MODULE(name_)
Define the user-specified module name for assertions in this file.
#define Q_NORETURN
no-return function specifier
char char_t
typedef for character strings.
#define Q_ASSERT_ID(id_, test_)
General purpose assertion with user-specified assertion-id.
int int_t
typedef for assertions-ids and line numbers in assertions.
#define Q_REQUIRE_ID(id_, test_)
Assertion for checking preconditions with user-specified assertion-id.
#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_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.
#define QS_BEGIN_PRE_(rec_, qs_id_)
#define QS_U8_PRE_(data_)
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_OBJ_PRE_(obj_)
#define QS_FUN_PRE_(fun_)
#define QS_TEC_PRE_(ctr_)
#define QS_END_NOCRIT_PRE_()
#define QS_U16_PRE_(data_)
#define QS_2U8_PRE_(data1_, data2_)
#define QS_SIG_PRE_(sig_)
#define QS_EQC_PRE_(ctr_)
Internal (package scope) QS/C++ interface.
#define QS_STR_PRE_(msg_)
Internal QS macro to output a zero-terminated ASCII string data element.
QS/C++ port to a 32-bit CPU, generic compiler.
Q_NORETURN Q_onAssert(char_t const *const module, int_t const location)
Callback function invoked in case of any assertion failure.
#define QF_MAX_ACTIVE
The maximum number of active objects in the application.
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..QF_MAX_ACTIVE
bool notEmpty(void) const noexcept
Evaluates to true if the priority set is not empty.
std::uint_fast8_t findMax(void) const noexcept