656 lines
23 KiB
C
Raw Normal View History

2013-12-30 17:37:40 -05:00
/*****************************************************************************
* Model: qmsmtst.qm
* File: ./qmsmtst.c
*
* This code has been generated by QM tool (see state-machine.com/qm).
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* 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.
*
* 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.
*****************************************************************************/
2014-04-06 11:43:13 -04:00
/*${.::qmsmtst.c} ..........................................................*/
2013-12-30 17:37:40 -05:00
#include "qep_port.h"
#include "qmsmtst.h"
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst} ..........................................................*/
typedef struct {
2013-12-30 17:37:40 -05:00
/* protected: */
QMsm super;
/* private: */
uint8_t foo;
} QMsmTst;
/* protected: */
static QState QMsmTst_initial(QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s_e(QMsmTst * const me);
static QState QMsmTst_s_x(QMsmTst * const me);
static QState QMsmTst_s_i(QMsmTst * const me);
static QMState const QMsmTst_s_s = {
2014-04-06 11:43:13 -04:00
(QMState const *)0, /* superstate (top) */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s_e),
Q_ACTION_CAST(&QMsmTst_s_x),
Q_ACTION_CAST(&QMsmTst_s_i)
2013-12-30 17:37:40 -05:00
};
static QState QMsmTst_s1 (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s1_e(QMsmTst * const me);
static QState QMsmTst_s1_x(QMsmTst * const me);
static QState QMsmTst_s1_i(QMsmTst * const me);
static QMState const QMsmTst_s1_s = {
2014-04-06 11:43:13 -04:00
&QMsmTst_s_s, /* superstate */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s1),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s1_e),
Q_ACTION_CAST(&QMsmTst_s1_x),
Q_ACTION_CAST(&QMsmTst_s1_i)
2013-12-30 17:37:40 -05:00
};
static QState QMsmTst_s11 (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s11_e(QMsmTst * const me);
static QState QMsmTst_s11_x(QMsmTst * const me);
static QMState const QMsmTst_s11_s = {
2014-04-06 11:43:13 -04:00
&QMsmTst_s1_s, /* superstate */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s11),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s11_e),
Q_ACTION_CAST(&QMsmTst_s11_x),
Q_ACTION_CAST(0) /* no intitial tran. */
2013-12-30 17:37:40 -05:00
};
static QState QMsmTst_s2 (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s2_e(QMsmTst * const me);
static QState QMsmTst_s2_x(QMsmTst * const me);
static QState QMsmTst_s2_i(QMsmTst * const me);
static QMState const QMsmTst_s2_s = {
2014-04-06 11:43:13 -04:00
&QMsmTst_s_s, /* superstate */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s2),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s2_e),
Q_ACTION_CAST(&QMsmTst_s2_x),
Q_ACTION_CAST(&QMsmTst_s2_i)
2013-12-30 17:37:40 -05:00
};
static QState QMsmTst_s21 (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s21_e(QMsmTst * const me);
static QState QMsmTst_s21_x(QMsmTst * const me);
static QState QMsmTst_s21_i(QMsmTst * const me);
static QMState const QMsmTst_s21_s = {
2014-04-06 11:43:13 -04:00
&QMsmTst_s2_s, /* superstate */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s21),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s21_e),
Q_ACTION_CAST(&QMsmTst_s21_x),
Q_ACTION_CAST(&QMsmTst_s21_i)
2013-12-30 17:37:40 -05:00
};
static QState QMsmTst_s211 (QMsmTst * const me, QEvt const * const e);
static QState QMsmTst_s211_e(QMsmTst * const me);
static QState QMsmTst_s211_x(QMsmTst * const me);
static QMState const QMsmTst_s211_s = {
2014-04-06 11:43:13 -04:00
&QMsmTst_s21_s, /* superstate */
2013-12-30 17:37:40 -05:00
Q_STATE_CAST(&QMsmTst_s211),
2014-04-06 11:43:13 -04:00
Q_ACTION_CAST(&QMsmTst_s211_e),
Q_ACTION_CAST(&QMsmTst_s211_x),
Q_ACTION_CAST(0) /* no intitial tran. */
2013-12-30 17:37:40 -05:00
};
static QMsmTst l_msmtst; /* the only instance of the QMsmTst class */
/* global-scope definitions ---------------------------------------*/
QMsm * const the_msm = (QMsm *)&l_msmtst; /* the opaque pointer */
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst_ctor} .....................................................*/
2013-12-30 17:37:40 -05:00
void QMsmTst_ctor(void) {
QMsmTst *me = &l_msmtst;
QMsm_ctor(&me->super, Q_STATE_CAST(&QMsmTst_initial));
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst} ..........................................................*/
/*${SMs::QMsmTst::SM} ......................................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_initial(QMsmTst * const me, QEvt const * const e) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s2_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s2_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s2_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::initial} */
2013-12-30 17:37:40 -05:00
(void)e; /* avoid compiler warning */
me->foo = 0U;
BSP_display("top-INIT;");
2014-04-06 11:43:13 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:37:40 -05:00
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s} ...................................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s_e(QMsmTst * const me) {
BSP_display("s-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s_s);
}
static QState QMsmTst_s_x(QMsmTst * const me) {
BSP_display("s-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s_s);
}
static QState QMsmTst_s_i(QMsmTst * const me) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s11_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s11_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::initial} */
2013-12-30 17:37:40 -05:00
BSP_display("s-INIT;");
2014-04-06 11:43:13 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:37:40 -05:00
}
static QState QMsmTst_s(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::I} */
2013-12-30 17:37:40 -05:00
case I_SIG: {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::I::[me->foo]} */
2013-12-30 17:37:40 -05:00
if (me->foo) {
me->foo = 0U;
BSP_display("s-I;");
status_ = QM_HANDLED();
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::E} */
2013-12-30 17:37:40 -05:00
case E_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s11_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s11_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s-E;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::TERMINATE} */
2013-12-30 17:37:40 -05:00
case TERMINATE_SIG: {
BSP_exit();
status_ = QM_HANDLED();
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return status_;
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s::s1} ...............................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s1_e(QMsmTst * const me) {
BSP_display("s1-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s1_s);
}
static QState QMsmTst_s1_x(QMsmTst * const me) {
BSP_display("s1-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s1_s);
}
static QState QMsmTst_s1_i(QMsmTst * const me) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[2];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s11_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s11_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::initial} */
2013-12-30 17:37:40 -05:00
BSP_display("s1-INIT;");
2014-04-06 11:43:13 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:37:40 -05:00
}
static QState QMsmTst_s1(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::I} */
2013-12-30 17:37:40 -05:00
case I_SIG: {
BSP_display("s1-I;");
status_ = QM_HANDLED();
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::D} */
2013-12-30 17:37:40 -05:00
case D_SIG: {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::D::[!me->foo]} */
2013-12-30 17:37:40 -05:00
if (!me->foo) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
me->foo = 1U;
BSP_display("s1-D;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::A} */
2013-12-30 17:37:40 -05:00
case A_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s1_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s1_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s1-A;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::B} */
2013-12-30 17:37:40 -05:00
case B_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[2];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s11_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s11_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s1-B;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::F} */
2013-12-30 17:37:40 -05:00
case F_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[5];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s211_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s2_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s21_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s211_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s1-F;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::C} */
2013-12-30 17:37:40 -05:00
case C_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s2_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s2_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s2_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s1-C;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s::s1::s11} ..........................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s11_e(QMsmTst * const me) {
BSP_display("s11-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s11_s);
}
static QState QMsmTst_s11_x(QMsmTst * const me) {
BSP_display("s11-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s11_s);
}
static QState QMsmTst_s11(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::s11::H} */
2013-12-30 17:37:40 -05:00
case H_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s11_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s11-H;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::s11::D} */
2013-12-30 17:37:40 -05:00
case D_SIG: {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::s11::D::[me->foo]} */
2013-12-30 17:37:40 -05:00
if (me->foo) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s1_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s11_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
me->foo = 0U;
BSP_display("s11-D;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s1::s11::G} */
2013-12-30 17:37:40 -05:00
case G_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[6];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s211_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s11_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s2_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s21_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s211_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s11-G;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s::s2} ...............................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s2_e(QMsmTst * const me) {
BSP_display("s2-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s2_s);
}
static QState QMsmTst_s2_x(QMsmTst * const me) {
BSP_display("s2-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s2_s);
}
static QState QMsmTst_s2_i(QMsmTst * const me) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s211_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s21_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s211_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::initial} */
2013-12-30 17:37:40 -05:00
BSP_display("s2-INIT;");
2014-04-06 11:43:13 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:37:40 -05:00
}
static QState QMsmTst_s2(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::I} */
2013-12-30 17:37:40 -05:00
case I_SIG: {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::I::[!me->foo]} */
2013-12-30 17:37:40 -05:00
if (!me->foo) {
me->foo = 1U;
BSP_display("s2-I;");
status_ = QM_HANDLED();
}
else {
status_ = QM_UNHANDLED();
}
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::F} */
2013-12-30 17:37:40 -05:00
case F_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s11_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s2_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s11_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s2-F;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::C} */
2013-12-30 17:37:40 -05:00
case C_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s1_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s2_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s1_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s2-C;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s::s2::s21} ..........................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s21_e(QMsmTst * const me) {
BSP_display("s21-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s21_s);
}
static QState QMsmTst_s21_x(QMsmTst * const me) {
BSP_display("s21-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s21_s);
}
static QState QMsmTst_s21_i(QMsmTst * const me) {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[2];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s211_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s211_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::initial} */
2013-12-30 17:37:40 -05:00
BSP_display("s21-INIT;");
2014-04-06 11:43:13 -04:00
return QM_TRAN_INIT(&tatbl_);
2013-12-30 17:37:40 -05:00
}
static QState QMsmTst_s21(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::G} */
2013-12-30 17:37:40 -05:00
case G_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[5];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s1_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s21_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s2_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s1_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s1_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s21-G;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::A} */
2013-12-30 17:37:40 -05:00
case A_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[4];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s21_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s21_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s21_e), /* entry */
Q_ACTION_CAST(&QMsmTst_s21_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s21-A;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::B} */
2013-12-30 17:37:40 -05:00
case B_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[2];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s211_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s211_e), /* entry */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s21-B;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}
2014-04-06 11:43:13 -04:00
/*${SMs::QMsmTst::SM::s::s2::s21::s211} ....................................*/
2013-12-30 17:37:40 -05:00
static QState QMsmTst_s211_e(QMsmTst * const me) {
BSP_display("s211-ENTRY;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_ENTRY(&QMsmTst_s211_s);
}
static QState QMsmTst_s211_x(QMsmTst * const me) {
BSP_display("s211-EXIT;");
2014-04-06 11:43:13 -04:00
(void)me; /* avoid compiler warning in case 'me' is not used */
2013-12-30 17:37:40 -05:00
return QM_EXIT(&QMsmTst_s211_s);
}
static QState QMsmTst_s211(QMsmTst * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::s211::H} */
2013-12-30 17:37:40 -05:00
case H_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[5];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s211_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s21_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s2_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s211-H;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
2014-04-06 11:43:13 -04:00
/* ${SMs::QMsmTst::SM::s::s2::s21::s211::D} */
2013-12-30 17:37:40 -05:00
case D_SIG: {
2014-04-06 11:43:13 -04:00
static struct {
QMState const *target;
QActionHandler act[3];
} const tatbl_ = { /* transition-action table */
&QMsmTst_s21_s, /* target state */
{
Q_ACTION_CAST(&QMsmTst_s211_x), /* exit */
Q_ACTION_CAST(&QMsmTst_s21_i), /* init.tran. */
Q_ACTION_CAST(0) /* zero terminator */
}
2013-12-30 17:37:40 -05:00
};
BSP_display("s211-D;");
2014-04-06 11:43:13 -04:00
status_ = QM_TRAN(&tatbl_);
2013-12-30 17:37:40 -05:00
break;
}
default: {
status_ = QM_SUPER();
break;
}
}
return status_;
}