qpcpp/source/qep_hsm.cpp

557 lines
20 KiB
C++
Raw Normal View History

2015-05-14 16:05:04 -04:00
/// @file
/// @brief QP::QHsm implementation
/// @ingroup qep
/// @cond
2014-04-13 21:35:34 -04:00
///***************************************************************************
2015-05-14 16:05:04 -04:00
/// Last updated for version 5.4.0
/// Last updated on 2015-04-29
2014-04-13 21:35:34 -04:00
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
///
/// This program is open source software: you can redistribute it and/or
/// modify it under the terms of the GNU General Public License as published
/// by the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// Alternatively, this program may be distributed and modified under the
/// terms of Quantum Leaps commercial licenses, which expressly supersede
/// the GNU General Public License and are specifically designed for
/// licensees interested in retaining the proprietary status of their code.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
///***************************************************************************
2015-05-14 16:05:04 -04:00
/// @endcond
2014-04-13 21:35:34 -04:00
#define QP_IMPL // this is QP implementation
#include "qep_port.h" // QEP port
#ifdef Q_SPY // QS software tracing enabled?
#include "qs_port.h" // include QS port
#else
#include "qs_dummy.h" // disable the QS software tracing
#endif // Q_SPY
2015-05-14 16:05:04 -04:00
#include "qassert.h" // QP embedded systems-friendly assertions
//! helper macro to trigger internal event in an HSM
#define QEP_TRIG_(state_, sig_) \
((*(state_))(this, &QEP_reservedEvt_[sig_]))
//! helper macro to trigger exit action in an HSM
#define QEP_EXIT_(state_) do { \
if (QEP_TRIG_(state_, Q_EXIT_SIG) == Q_RET_HANDLED) { \
QS_BEGIN_(QS_QEP_STATE_EXIT, QS::priv_.smObjFilter, this) \
QS_OBJ_(this); \
QS_FUN_(state_); \
QS_END_() \
} \
} while (false)
//! helper macro to trigger entry action in an HSM
#define QEP_ENTER_(state_) do { \
if (QEP_TRIG_(state_, Q_ENTRY_SIG) == Q_RET_HANDLED) { \
QS_BEGIN_(QS_QEP_STATE_ENTRY, QS::priv_.smObjFilter, this) \
QS_OBJ_(this); \
QS_FUN_(state_); \
QS_END_() \
} \
} while (false)
2012-08-14 18:00:48 -04:00
2013-10-10 20:01:51 -04:00
namespace QP {
2012-08-14 18:00:48 -04:00
2015-05-14 16:05:04 -04:00
Q_DEFINE_THIS_MODULE("qep_hsm")
//****************************************************************************
enum {
QEP_EMPTY_SIG_ = 0 //!< empty signal for internal use only
};
//***************************************************************************/
/// @description
/// Static, preallocated standard events that the QEP event processor sends
/// to state handler functions of QP::QHsm and QP::QFsm subclasses to execute
/// entry actions, exit actions, and initial transitions.
///
static QEvt const QEP_reservedEvt_[4] = {
#ifdef Q_EVT_CTOR // Is the QEvt constructor provided?
static_cast<QSignal>(0),
static_cast<QSignal>(1),
static_cast<QSignal>(2),
static_cast<QSignal>(3)
#else // QEvt is a POD (Plain Old Datatype)
{ static_cast<QSignal>(0),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(1),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(2),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(3),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) }
#endif
};
//****************************************************************************
/// @description
/// Performs the first step of HSM initialization by assigning the initial
/// pseudostate to the currently active state of the state machine.
///
/// @param[in] initial pointer to the top-most initial state-handler
/// function in the derived state machine
///
QHsm::QHsm(QStateHandler const initial)
: QMsm(initial)
{
m_state.fun = Q_STATE_CAST(&QHsm::top);
}
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
//****************************************************************************
2015-05-14 16:05:04 -04:00
/// @description
/// Executes the top-most initial transition in a HSM.
///
/// @param[in] e pointer to the initialization event (might be NULL)
///
/// @note Must be called exactly __once__ before the QP::QHsm::dispatch().
///
void QHsm::init(QEvt const * const e) {
QStateHandler t = m_state.fun;
/// @pre ctor must be executed and initial tran. NOT taken
Q_REQUIRE_ID(200, (m_temp.fun != Q_STATE_CAST(0))
&& (t == Q_STATE_CAST(&QHsm::top)));
// execute the top-most initial transition
QState r = (*m_temp.fun)(this, e);
// the top-most initial transition must be taken
Q_ASSERT_ID(210, r == Q_RET_TRAN);
QS_CRIT_STAT_
// drill down into the state hierarchy with initial transitions...
do {
// transition entry path
QStateHandler path[MAX_NEST_DEPTH_];
// transition entry path index
int_fast8_t ip = static_cast<int_fast8_t>(0);
QS_BEGIN_(QS_QEP_STATE_INIT, QS::priv_.smObjFilter, this)
QS_OBJ_(this); // this state machine object
QS_FUN_(t); // the source state
QS_FUN_(m_temp.fun); // the target of the initial transition
QS_END_()
path[0] = m_temp.fun;
(void)QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_);
while (m_temp.fun != t) {
++ip;
Q_ASSERT_ID(220, ip < static_cast<int_fast8_t>(Q_DIM(path)));
path[ip] = m_temp.fun;
(void)QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_);
}
m_temp.fun = path[0];
// retrace the entry path in reverse (desired) order...
do {
QEP_ENTER_(path[ip]); // enter path[ip]
--ip;
} while (ip >= static_cast<int_fast8_t>(0));
t = path[0]; // current state becomes the new source
} while (QEP_TRIG_(t, Q_INIT_SIG) == Q_RET_TRAN);
QS_BEGIN_(QS_QEP_STATE_INIT, QS::priv_.smObjFilter, this)
QS_OBJ_(this); // this state machine object
QS_FUN_(&QHsm::top); // source of initial tran (the top state)
QS_FUN_(t); // the new active state
QS_END_()
m_state.fun = t; // change the current active state
m_temp.fun = t; // mark the configuration as stable
}
//***************************************************************************/
/// @description
/// The QP::QHsm::top() state handler is the ultimate root of state hierarchy
/// in all HSMs derived from QP::QHsm.
///
/// @param[in] e pointer to the event to be dispatched to the HSM
///
/// @returns Always returns #Q_RET_IGNORED, which means that the top state
/// ignores all events.
///
/// @note
/// The arguments to this state handler are not used. They are provided for
/// conformance with the state-handler function signature QP::QStateHandler.
///
QState QHsm::top(void * const, QEvt const * const) {
return Q_RET_IGNORED; // the top state ignores all events
}
//****************************************************************************
/// @description
2014-04-13 21:35:34 -04:00
/// Dispatches an event for processing to a hierarchical state machine (HSM).
/// The processing of an event represents one run-to-completion (RTC) step.
///
2015-05-14 16:05:04 -04:00
/// @param[in] e pointer to the event to be dispatched to the HSM
2014-04-13 21:35:34 -04:00
///
2015-05-14 16:05:04 -04:00
/// @note
2014-04-13 21:35:34 -04:00
/// This state machine must be initialized by calling QP::QHsm::init() exactly
/// __once__ before calling QP::QHsm::dispatch().
///
2012-08-14 18:00:48 -04:00
void QHsm::dispatch(QEvt const * const e) {
2013-10-10 20:01:51 -04:00
QStateHandler t = m_state.fun;
2012-08-14 18:00:48 -04:00
2015-05-14 16:05:04 -04:00
/// @pre the state configuration must be stable
Q_REQUIRE_ID(400, t == m_temp.fun);
2012-08-14 18:00:48 -04:00
QStateHandler s;
QState r;
QS_CRIT_STAT_
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_DISPATCH, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_TIME_(); // time stamp
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(t); // the current state
2012-08-14 18:00:48 -04:00
QS_END_()
2014-04-13 21:35:34 -04:00
// process the event hierarchically...
do {
2013-10-10 20:01:51 -04:00
s = m_temp.fun;
2014-04-13 21:35:34 -04:00
r = (*s)(this, e); // invoke state handler s
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
// unhandled due to a guard?
if (r == Q_RET_UNHANDLED) {
2012-08-14 18:00:48 -04:00
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_UNHANDLED, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(s); // the current state
2012-08-14 18:00:48 -04:00
QS_END_()
2014-04-13 21:35:34 -04:00
r = QEP_TRIG_(s, QEP_EMPTY_SIG_); // find superstate of s
2012-08-14 18:00:48 -04:00
}
} while (r == Q_RET_SUPER);
2014-04-13 21:35:34 -04:00
// transition taken?
if ((r == Q_RET_TRAN) || (r == Q_RET_TRAN_HIST)) {
QStateHandler path[MAX_NEST_DEPTH_];
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
path[0] = m_temp.fun; // save the target of the transition
2012-08-14 18:00:48 -04:00
path[1] = t;
2013-12-30 17:41:15 -05:00
path[2] = s;
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
// exit current state to transition source s...
while (t != s) {
// exit handled?
if (QEP_TRIG_(t, Q_EXIT_SIG) == Q_RET_HANDLED) {
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_STATE_EXIT, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_OBJ_(this); // this state machine object
QS_FUN_(t); // the exited state
2012-08-14 18:00:48 -04:00
QS_END_()
2014-04-13 21:35:34 -04:00
(void)QEP_TRIG_(t, QEP_EMPTY_SIG_); // find superstate of t
2012-08-14 18:00:48 -04:00
}
2014-04-13 21:35:34 -04:00
t = m_temp.fun; // m_temp.fun holds the superstate
2012-08-14 18:00:48 -04:00
}
2014-04-13 21:35:34 -04:00
int_fast8_t ip = hsm_tran(path); // take the HSM transition
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
// retrace the entry path in reverse (desired) order...
2015-05-14 16:05:04 -04:00
for (; ip >= static_cast<int_fast8_t>(0); --ip) {
2014-04-13 21:35:34 -04:00
QEP_ENTER_(path[ip]); // enter path[ip]
2012-08-14 18:00:48 -04:00
}
2014-04-13 21:35:34 -04:00
t = path[0]; // stick the target into register
m_temp.fun = t; // update the next state
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
// drill into the target hierarchy...
2012-08-14 18:00:48 -04:00
while (QEP_TRIG_(t, Q_INIT_SIG) == Q_RET_TRAN) {
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_STATE_INIT, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_OBJ_(this); // this state machine object
QS_FUN_(t); // the source (pseudo)state
QS_FUN_(m_temp.fun); // the target of the transition
2012-08-14 18:00:48 -04:00
QS_END_()
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(0);
2013-10-10 20:01:51 -04:00
path[0] = m_temp.fun;
2014-04-13 21:35:34 -04:00
(void)QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_); // find superstate
2013-10-10 20:01:51 -04:00
while (m_temp.fun != t) {
2012-08-14 18:00:48 -04:00
++ip;
2013-10-10 20:01:51 -04:00
path[ip] = m_temp.fun;
(void)QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_);// find superstate
2012-08-14 18:00:48 -04:00
}
2013-10-10 20:01:51 -04:00
m_temp.fun = path[0];
2012-08-14 18:00:48 -04:00
2014-04-13 21:35:34 -04:00
// entry path must not overflow
2015-05-14 16:05:04 -04:00
Q_ASSERT_ID(410, ip < static_cast<int_fast8_t>(MAX_NEST_DEPTH_));
2014-04-13 21:35:34 -04:00
// retrace the entry path in reverse (correct) order...
do {
QEP_ENTER_(path[ip]); // enter path[ip]
2012-08-14 18:00:48 -04:00
--ip;
2015-05-14 16:05:04 -04:00
} while (ip >= static_cast<int_fast8_t>(0));
2012-08-14 18:00:48 -04:00
t = path[0];
}
2014-04-13 21:35:34 -04:00
#ifdef Q_SPY
if (r == Q_RET_TRAN) {
QS_BEGIN_(QS_QEP_TRAN, QS::priv_.smObjFilter, this)
QS_TIME_(); // time stamp
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(s); // the source of the transition
QS_FUN_(t); // the new active state
QS_END_()
}
else {
QS_BEGIN_(QS_QEP_TRAN_HIST, QS::priv_.smObjFilter, this)
QS_TIME_(); // time stamp
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(s); // the source of the transition
QS_FUN_(t); // the new active state
QS_END_()
}
#endif // Q_SPY
2012-08-14 18:00:48 -04:00
}
2014-04-13 21:35:34 -04:00
// transition not taken
else {
2012-08-14 18:00:48 -04:00
#ifdef Q_SPY
if (r == Q_RET_HANDLED) {
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_INTERN_TRAN, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_TIME_(); // time stamp
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(m_state.fun);// the state that handled the event
2012-08-14 18:00:48 -04:00
QS_END_()
}
else {
2013-10-10 20:01:51 -04:00
QS_BEGIN_(QS_QEP_IGNORED, QS::priv_.smObjFilter, this)
2014-04-13 21:35:34 -04:00
QS_TIME_(); // time stamp
QS_SIG_(e->sig); // the signal of the event
QS_OBJ_(this); // this state machine object
QS_FUN_(m_state.fun);// the current state
2012-08-14 18:00:48 -04:00
QS_END_()
}
#endif
}
2014-04-13 21:35:34 -04:00
m_state.fun = t; // change the current active state
m_temp.fun = t; // mark the configuration as stable
2012-08-14 18:00:48 -04:00
}
2014-04-13 21:35:34 -04:00
//****************************************************************************
2015-05-14 16:05:04 -04:00
/// @description
2014-04-13 21:35:34 -04:00
/// helper function to execute transition sequence in a hierarchical state
/// machine (HSM).
///
2015-05-14 16:05:04 -04:00
/// @param[in,out] path array of pointers to state-handler functions
/// to execute the entry actions
2014-04-13 21:35:34 -04:00
///
2015-05-14 16:05:04 -04:00
/// @returns the depth of the entry path stored in the @p path parameter.
2014-04-13 21:35:34 -04:00
////
int_fast8_t QHsm::hsm_tran(QStateHandler (&path)[MAX_NEST_DEPTH_]) {
2015-05-14 16:05:04 -04:00
// transition entry path index
int_fast8_t ip = static_cast<int_fast8_t>(-1);
int_fast8_t iq; // helper transition entry path index
2013-12-30 17:41:15 -05:00
QStateHandler t = path[0];
QStateHandler s = path[2];
QState r;
QS_CRIT_STAT_
2014-04-13 21:35:34 -04:00
// (a) check source==target (transition to self)
if (s == t) {
QEP_EXIT_(s); // exit the source
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(0); // cause entering the target
2013-12-30 17:41:15 -05:00
}
else {
2014-04-13 21:35:34 -04:00
(void)QEP_TRIG_(t, QEP_EMPTY_SIG_); // superstate of target
2013-12-30 17:41:15 -05:00
t = m_temp.fun;
2014-04-13 21:35:34 -04:00
// (b) check source==target->super
if (s == t) {
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(0); // cause entering the target
2013-12-30 17:41:15 -05:00
}
else {
2014-04-13 21:35:34 -04:00
(void)QEP_TRIG_(s, QEP_EMPTY_SIG_); // superstate of src
// (c) check source->super==target->super
2013-12-30 17:41:15 -05:00
if (m_temp.fun == t) {
2014-04-13 21:35:34 -04:00
QEP_EXIT_(s); // exit the source
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(0); // cause entering the target
2013-12-30 17:41:15 -05:00
}
else {
2014-04-13 21:35:34 -04:00
// (d) check source->super==target
2013-12-30 17:41:15 -05:00
if (m_temp.fun == path[0]) {
2014-04-13 21:35:34 -04:00
QEP_EXIT_(s); // exit the source
2013-12-30 17:41:15 -05:00
}
2015-05-14 16:05:04 -04:00
else {
// (e) check rest of source==target->super->super..
// and store the entry path along the way
// indicate that the LCA was not found
iq = static_cast<int_fast8_t>(0);
// enter target and its superstate
ip = static_cast<int_fast8_t>(1);
2014-04-13 21:35:34 -04:00
path[1] = t; // save the superstate of target
t = m_temp.fun; // save source->super
// find target->super->super
2013-12-30 17:41:15 -05:00
r = QEP_TRIG_(path[1], QEP_EMPTY_SIG_);
while (r == Q_RET_SUPER) {
++ip;
2014-04-13 21:35:34 -04:00
path[ip] = m_temp.fun; // store the entry path
2015-05-14 16:05:04 -04:00
if (m_temp.fun == s) { // is it the source?
// indicate that the LCA was found
iq = static_cast<int_fast8_t>(1);
2014-04-13 21:35:34 -04:00
// entry path must not overflow
2015-05-14 16:05:04 -04:00
Q_ASSERT_ID(520,
ip < static_cast<int_fast8_t>(MAX_NEST_DEPTH_));
2014-04-13 21:35:34 -04:00
--ip; // do not enter the source
r = Q_RET_HANDLED; // terminate the loop
2013-12-30 17:41:15 -05:00
}
2014-04-13 21:35:34 -04:00
// it is not the source, keep going up
else {
2013-12-30 17:41:15 -05:00
r = QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_);
}
}
2014-04-13 21:35:34 -04:00
// LCA found yet?
2015-05-14 16:05:04 -04:00
if (iq == static_cast<int_fast8_t>(0)) {
2014-04-13 21:35:34 -04:00
// entry path must not overflow
2015-05-14 16:05:04 -04:00
Q_ASSERT_ID(510,
ip < static_cast<int_fast8_t>(MAX_NEST_DEPTH_));
2014-04-13 21:35:34 -04:00
QEP_EXIT_(s); // exit the source
2013-12-30 17:41:15 -05:00
// (f) check the rest of source->super
// == target->super->super...
//
iq = ip;
2014-04-13 21:35:34 -04:00
r = Q_RET_IGNORED; // indicate LCA NOT found
2013-12-30 17:41:15 -05:00
do {
2014-04-13 21:35:34 -04:00
// is this the LCA?
if (t == path[iq]) {
r = Q_RET_HANDLED; // indicate LCA found
// do not enter LCA
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(
iq - static_cast<int_fast8_t>(1));
// cause termination of the loop
iq = static_cast<int_fast8_t>(-1);
2013-12-30 17:41:15 -05:00
}
else {
2014-04-13 21:35:34 -04:00
--iq; // try lower superstate of target
2013-12-30 17:41:15 -05:00
}
2015-05-14 16:05:04 -04:00
} while (iq >= static_cast<int_fast8_t>(0));
2013-12-30 17:41:15 -05:00
2014-04-13 21:35:34 -04:00
// LCA not found yet?
if (r != Q_RET_HANDLED) {
2013-12-30 17:41:15 -05:00
// (g) check each source->super->...
// for each target->super...
//
2014-04-13 21:35:34 -04:00
r = Q_RET_IGNORED; // keep looping
2013-12-30 17:41:15 -05:00
do {
2014-04-13 21:35:34 -04:00
// exit t unhandled?
2013-12-30 17:41:15 -05:00
if (QEP_TRIG_(t, Q_EXIT_SIG) == Q_RET_HANDLED)
{
QS_BEGIN_(QS_QEP_STATE_EXIT,
QS::priv_.smObjFilter, this)
QS_OBJ_(this);
QS_FUN_(t);
QS_END_()
(void)QEP_TRIG_(t, QEP_EMPTY_SIG_);
}
2014-04-13 21:35:34 -04:00
t = m_temp.fun; // set to super of t
2013-12-30 17:41:15 -05:00
iq = ip;
do {
2014-04-13 21:35:34 -04:00
// is this LCA?
if (t == path[iq]) {
// do not enter LCA
2015-05-14 16:05:04 -04:00
ip = static_cast<int_fast8_t>(
iq - static_cast<int_fast8_t>(1));
// break out of inner loop
iq = static_cast<int_fast8_t>(-1);
2014-04-13 21:35:34 -04:00
r = Q_RET_HANDLED; // break outer loop
2013-12-30 17:41:15 -05:00
}
else {
--iq;
}
2015-05-14 16:05:04 -04:00
} while (iq >= static_cast<int_fast8_t>(0));
2013-12-30 17:41:15 -05:00
} while (r != Q_RET_HANDLED);
}
}
}
}
}
}
return ip;
}
2012-08-14 18:00:48 -04:00
2015-05-14 16:05:04 -04:00
//****************************************************************************
/// @description
/// Tests if a state machine derived from QHsm is-in a given state.
///
/// @note
/// For a HSM, to "be in a state" means also to be in a superstate of
/// of the state.
///
/// @param[in] state pointer to the state-handler function to be tested
///
/// @returns 'true' if the HSM is in the @p state and 'false' otherwise
///
bool QHsm::isIn(QStateHandler const s) {
2013-10-10 20:01:51 -04:00
2015-05-14 16:05:04 -04:00
/// @pre state configuration must be stable
Q_REQUIRE_ID(600, m_temp.fun == m_state.fun);
bool inState = false; // assume that this HSM is not in 'state'
QState r;
// scan the state hierarchy bottom-up
do {
// do the states match?
if (m_temp.fun == s) {
inState = true; // match found, return TRUE
r = Q_RET_IGNORED; // cause breaking out of the loop
}
else {
r = QEP_TRIG_(m_temp.fun, QEP_EMPTY_SIG_);
}
} while (r != Q_RET_IGNORED); // QHsm_top state not reached
m_temp.fun = m_state.fun; // restore the stable state configuration
return inState; // return the status
}
} // namespace QP