46Q_DEFINE_THIS_MODULE(
"qep_hsm")
50#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
51#error qpc version 7.3.0 or higher required
74#define QHSM_RESERVED_EVT_(state_, sig_) \
75 ((*(state_))(me, &QEvt_reserved_[(sig_)]))
78#define QS_STATE_ENTRY_(state_, qsId_) \
81 QS_BEGIN_PRE(QS_QEP_STATE_ENTRY, (qsId_)) \
89#define QS_STATE_EXIT_(state_, qsId_) \
92 QS_BEGIN_PRE(QS_QEP_STATE_EXIT, (qsId_)) \
104 QHSM_MAX_NEST_DEPTH_ = 6
121 ,&QHsm_getStateHandler_
134 void const *
const e,
135 uint_fast8_t
const qsId)
145 if ((QS_priv_.flags & 0x01U) == 0U) {
146 QS_priv_.flags |= 0x01U;
194 while ((me->
temp.
fun != t) && (ip < (QHSM_MAX_NEST_DEPTH_ - 1))) {
213 QS_STATE_ENTRY_(path[ip], qsId);
259 QEvt const *
const e,
260 uint_fast8_t
const qsId)
293 int_fast8_t ip = QHSM_MAX_NEST_DEPTH_;
341 ip = QHSM_MAX_NEST_DEPTH_;
342 for (; (t != s) && (ip > 0); t = me->
temp.
fun) {
345 QS_STATE_EXIT_(t, qsId);
355 ip = QHsm_tran_(me, path, qsId);
359 for (; ip >= 0; --ip) {
364 QS_STATE_ENTRY_(path[ip], qsId);
390 while ((me->
temp.
fun != t) && (ip < (QHSM_MAX_NEST_DEPTH_ - 1))) {
410 QS_STATE_ENTRY_(path[ip], qsId);
484 bool inState =
false;
488 int_fast8_t lbound = QHSM_MAX_NEST_DEPTH_ + 1;
518 bool isFound =
false;
523 int_fast8_t lbound = QHSM_MAX_NEST_DEPTH_;
556int_fast8_t QHsm_tran_(
559 uint_fast8_t
const qsId)
574 QS_STATE_EXIT_(s, qsId);
596 QS_STATE_EXIT_(s, qsId);
605 QS_STATE_EXIT_(s, qsId);
620 && (ip < (QHSM_MAX_NEST_DEPTH_ - 1)))
646 QS_STATE_EXIT_(s, qsId);
670 int_fast8_t lbound = QHSM_MAX_NEST_DEPTH_;
676 QS_STATE_EXIT_(t, qsId);
714 QEvt const *
const e)
@ Q_RET_HANDLED
event handled (internal transition)
@ Q_RET_IGNORED
event silently ignored (bubbled up to top)
@ Q_RET_TRAN
regular transition
@ Q_RET_UNHANDLED
event unhandled due to guard
@ Q_RET_SUPER
event passed to superstate to handle
@ Q_RET_TRAN_HIST
transition to history of a given state
QEvt const QEvt_reserved_[4]
char const QP_versionStr[16]
the current QP version number string in ROM, based on QP_VERSION_STR
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define QP_VERSION_STR
Version string complying with Semantic Versioning
#define Q_STATE_CAST(handler_)
Perform cast to QStateHandler.
#define Q_EXIT_SIG
reserved signal sent to state handler to execute the exit case)
QState(* QStateHandler)(void *const me, QEvt const *const e)
Pointer to a state-handler function.
enum QStateRet QState
Type returned from state-handler functions.
#define Q_EVT_CAST(class_)
Perform downcast of an event onto a subclass of QEvt class_
#define Q_ENTRY_SIG
reserved signal sent to state handler to execute the entry case)
#define Q_INIT_SIG
reserved signal sent to state handler to execute the initial transition)
#define Q_EMPTY_SIG
reserved signal sent to state handler to execute the default case)
#define QEVT_INITIALIZER(sig_)
Initializer for immutable (constant) QEvt instances.
Internal (package scope) QP/C interface.
#define QS_FUN_DICTIONARY(fun_)
#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_)
Abstract State Machine class (state machine interface)
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also Object Orientation)
union QAsmAttr state
Current state (pointer to the current state-handler function)
union QAsmAttr temp
Temporary storage for target/act-table etc.
Virtual table for the QAsm class.
QSignal sig
Signal of the event (see Event Signal)
Hierarchical State Machine class (QHsm-style state machine implementation strategy)