qepn.c File Reference

#include "qpn_port.h"

Go to the source code of this file.

Defines

#define QEP_EMPTY_SIG_   0
#define QEP_MAX_NEST_DEPTH_   5

Functions

char const Q_ROM *Q_ROM_VAR QP_getVersion (void)
 get the current QP version number string
void QFsm_init (QFsm *me)
 Initializes a FSM.
void QFsm_dispatch (QFsm *me) Q_REENTRANT
 Dispatches an event to a FSM.
QState QHsm_top (QHsm *me)
 The top-state.
void QHsm_init (QHsm *me)
 Initializes a HSM.
void QHsm_dispatch (QHsm *me) Q_REENTRANT
 Dispatches an event to a HSM.


Detailed Description

QEP-nano implementation.

Definition in file qepn.c.


Define Documentation

#define QEP_EMPTY_SIG_   0

empty signal for internal use only

Definition at line 41 of file qepn.c.

Referenced by QHsm_dispatch(), and QHsm_init().

#define QEP_MAX_NEST_DEPTH_   5

maximum depth of state nesting (including the top level), must be >= 2

Definition at line 44 of file qepn.c.

Referenced by QHsm_dispatch(), and QHsm_init().


Function Documentation

void QFsm_dispatch ( QFsm me  ) 

Dispatches an event to a FSM.

Processes one event at a time in Run-to-Completion fashion. The argument me is the pointer the state machine structure derived from QFsm.

Note:
Must be called after QFsm_init().

Definition at line 65 of file qepn.c.

References Q_ENTRY_SIG, Q_EXIT_SIG, Q_RET_TRAN, Q_SIG, and QFsm::state.

Referenced by QK_schedule_().

void QFsm_init ( QFsm me  ) 

Initializes a FSM.

Takes the top-most initial transition in a FSM.

Parameters:
me is the pointer the state machine structure derived from FHsm.
Note:
Must be called only ONCE after QFsm_ctor() and before any calls to QFsm_dispatch().

Definition at line 55 of file qepn.c.

References Q_ENTRY_SIG, Q_SIG, and QFsm::state.

Referenced by QF_run().

void QHsm_dispatch ( QHsm me  ) 

Dispatches an event to a HSM.

Processes one event at a time in Run-to-Completion fashion. me is the pointer the state machine structure derived from QHsm.

Note:
Must be called repetitively for each event after QHsm_init().

Definition at line 121 of file qepn.c.

References Q_ASSERT, Q_ENTRY_SIG, Q_EXIT_SIG, Q_INIT_SIG, Q_RET_HANDLED, Q_RET_IGNORED, Q_RET_SUPER, Q_RET_TRAN, Q_SIG, QEP_EMPTY_SIG_, and QEP_MAX_NEST_DEPTH_.

Referenced by QK_schedule_().

void QHsm_init ( QHsm me  ) 

Initializes a HSM.

Takes the top-most initial transition in a HSM.

Parameters:
me is the pointer the state machine structure derived from QHsm.
Note:
Must be called only ONCE after QHsm_ctor() and before any calls to QHsm_dispatch().

Definition at line 86 of file qepn.c.

References Q_ALLEGE, Q_ASSERT, Q_ENTRY_SIG, Q_INIT_SIG, Q_RET_TRAN, Q_SIG, QEP_EMPTY_SIG_, QEP_MAX_NEST_DEPTH_, and QHsm_top().

Referenced by QF_run().

QState QHsm_top ( QHsm me  ) 

The top-state.

QHsm_top() is the ultimate root of state hierarchy in all HSMs derived from QHsm. This state handler always returns (QState)0, which means that it "handles" all events.

See also:
Example of the QCalc_on() state handler for Q_INIT().

Definition at line 81 of file qepn.c.

References Q_IGNORED.

Referenced by QHsm_init().

char const Q_ROM* Q_ROM_VAR QP_getVersion ( void   ) 

get the current QP version number string

Returns:
version of the QP as a constant 6-character string of the form x.y.zz, where x is a 1-digit major version number, y is a 1-digit minor version number, and zz is a 2-digit release number.

Definition at line 48 of file qepn.c.

References Q_ROM, and Q_ROM_VAR.


Generated on Sat Nov 15 13:56:09 2008 for QP-nano by  doxygen 1.5.4