QP/C  7.0.0
Real-Time Embedded Framework
qep_hsm.c File Reference

QHsm implementation More...

#include "qep_port.h"
#include "qassert.h"
#include "qs_port.h"
#include "qs_pkg.h"

Go to the source code of this file.

Macros

#define QEP_EXIT_(state_, qs_id_)
 
#define QEP_ENTER_(state_, qs_id_)
 

Enumerations

enum  { QEP_EMPTY_SIG_ = 0 , QHSM_MAX_NEST_DEPTH_ = 6 }
 

Functions

static QState QHsm_trig_ (QHsm *const me, QStateHandler const state, QSignal sig)
 
static int_fast8_t QHsm_tran_ (QHsm *const me, QStateHandler path[QHSM_MAX_NEST_DEPTH_], uint_fast8_t const qs_id)
 
QStateHandler QHsm_getStateHandler_ (QHsm *const me)
 

Variables

char const QP_versionStr [7] = QP_VERSION_STR
 
static QEvt const QEP_reservedEvt_ []
 

Detailed Description

Date
Last updated on: 2021-12-23
Version
Last updated for: Version 7.0.0, 2022-04-30
Traceability:

traces to: RQP103

traces to: RQP104

traces to: RQP120

traces to: RQP130

Definition in file qep_hsm.c.

Macro Definition Documentation

◆ QEP_EXIT_

#define QEP_EXIT_ (   state_,
  qs_id_ 
)
Value:
do { \
if ((*(state_))(me, &QEP_reservedEvt_[Q_EXIT_SIG]) \
QS_BEGIN_PRE_(QS_QEP_STATE_EXIT, (qs_id_)) \
QS_OBJ_PRE_(me); \
QS_FUN_PRE_(state_); \
QS_END_PRE_() \
} \
} while (false)
@ Q_RET_HANDLED
Definition: qep.h:578
uint_fast8_t QState
Definition: qep.h:170
@ Q_EXIT_SIG
Definition: qep.h:689
static QEvt const QEP_reservedEvt_[]
Definition: qep_hsm.c:66
@ QS_QEP_STATE_EXIT
Definition: qs.h:59

Definition at line 81 of file qep_hsm.c.

◆ QEP_ENTER_

#define QEP_ENTER_ (   state_,
  qs_id_ 
)
Value:
do { \
if ((*(state_))(me, &QEP_reservedEvt_[Q_ENTRY_SIG]) \
QS_BEGIN_PRE_(QS_QEP_STATE_ENTRY, (qs_id_)) \
QS_OBJ_PRE_(me); \
QS_FUN_PRE_(state_); \
QS_END_PRE_() \
} \
} while (false)
@ Q_ENTRY_SIG
Definition: qep.h:688
@ QS_QEP_STATE_ENTRY
Definition: qs.h:58

Definition at line 91 of file qep_hsm.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

internal QEP constants

Enumerator
QEP_EMPTY_SIG_ 

reserved empty signal for internal use only

QHSM_MAX_NEST_DEPTH_ 

maximum depth of state nesting in a HSM (including the top level), must be >= 3

Definition at line 51 of file qep_hsm.c.

Function Documentation

◆ QHsm_trig_()

static QState QHsm_trig_ ( QHsm *const  me,
QStateHandler const  state,
QSignal  sig 
)
inlinestatic

helper function to trigger reserved event in an HSM

Definition at line 74 of file qep_hsm.c.

◆ QHsm_tran_()

static int_fast8_t QHsm_tran_ ( QHsm *const  me,
QStateHandler  path[QHSM_MAX_NEST_DEPTH_],
uint_fast8_t const  qs_id 
)
static

helper function to execute state transition

◆ QHsm_getStateHandler_()

QStateHandler QHsm_getStateHandler_ ( QHsm *const  me)

Definition at line 605 of file qep_hsm.c.

Variable Documentation

◆ QP_versionStr

char const QP_versionStr[7] = QP_VERSION_STR

the current QP version number string in ROM, based on QP_VERSION_STR

Definition at line 47 of file qep_hsm.c.

◆ QEP_reservedEvt_

QEvt const QEP_reservedEvt_[]
static
Initial value:
= {
{ (QSignal)QEP_EMPTY_SIG_, 0U, 0U },
{ (QSignal)Q_ENTRY_SIG, 0U, 0U },
{ (QSignal)Q_EXIT_SIG, 0U, 0U },
{ (QSignal)Q_INIT_SIG, 0U, 0U }
}
@ Q_INIT_SIG
Definition: qep.h:690
uint16_t QSignal
Definition: qep.h:97
@ QEP_EMPTY_SIG_
Definition: qep_hsm.c:52

Static, pre-allocated standard events that the QEP event processor sends to state handler functions of QHsm-style state machine to execute entry actions, exit actions, and initial transitions.

Definition at line 66 of file qep_hsm.c.