60 lines
1.6 KiB
C
60 lines
1.6 KiB
C
#ifndef __CHILD_FSM_H_
|
||
#define __CHILD_FSM_H_
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 提前做类型声明 */
|
||
/* -------------------------------------------------------------------------- */
|
||
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 自定义数据和信号 */
|
||
/* -------------------------------------------------------------------------- */
|
||
/**
|
||
* @brief 自定义外部信号,目前最多15个
|
||
* @details 因为是Unint16存储的信号位
|
||
*
|
||
*/
|
||
enum ChildFSMSignals{
|
||
Signal_toD = 1, /**< 必须从1开始,0预留给Idle信号了*/
|
||
Signal_toE,
|
||
};
|
||
|
||
/**
|
||
* @brief 自定义外部数据
|
||
*
|
||
*/
|
||
typedef struct ChildFSMExternalData
|
||
{
|
||
int arrindex;
|
||
int x;
|
||
}ChildFSMExternalData;
|
||
|
||
|
||
/**
|
||
* @brief 自定义内部数据
|
||
*
|
||
*/
|
||
typedef struct ChildFSMInnerData
|
||
{
|
||
int y1;
|
||
int inner1;
|
||
}ChildFSMInnerData;
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 下面的改个名字就行了 */
|
||
/* -------------------------------------------------------------------------- */
|
||
#define ChildFSM_Input(pFSM) ((ChildFSMExternalData *)_preloadIn((FSM *)pFSM)) /**< @deprecated 暂时弃用 */
|
||
|
||
typedef struct ChildFSMData
|
||
{
|
||
ChildFSMExternalData external;
|
||
ChildFSMInnerData internal;
|
||
}ChildFSMData;
|
||
|
||
typedef struct ChildFSM ChildFSM;
|
||
ChildFSM *createChildFSM();
|
||
|
||
|
||
|
||
|
||
#endif
|