64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
#ifndef __PARENT_FSM_H_
|
||
#define __PARENT_FSM_H_
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 提前做类型声明 */
|
||
/* -------------------------------------------------------------------------- */
|
||
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 自定义数据和信号 */
|
||
/* -------------------------------------------------------------------------- */
|
||
/**
|
||
* @brief 自定义外部信号,目前最多15个
|
||
* @details 因为是Unint16存储的信号位
|
||
*
|
||
*/
|
||
enum ParentFSMSignals{
|
||
Signal_toA = 1, /**< 必须从1开始,0预留给Idle信号了*/
|
||
Signal_toB,
|
||
Signal_toC,
|
||
};
|
||
|
||
/**
|
||
* @brief 自定义外部数据
|
||
*
|
||
*/
|
||
typedef struct ParentFSMExternalData
|
||
{
|
||
int arrindex;
|
||
int x;
|
||
}ParentFSMExternalData;
|
||
|
||
|
||
/**
|
||
* @brief 自定义内部数据
|
||
*
|
||
*/
|
||
typedef struct ParentFSMInnerData
|
||
{
|
||
int y1;
|
||
int inner1;
|
||
}ParentFSMInnerData;
|
||
|
||
|
||
|
||
|
||
/* -------------------------------------------------------------------------- */
|
||
/* 下面的改个名字就行了 */
|
||
/* -------------------------------------------------------------------------- */
|
||
#define ParentFSM_Input(pFSM) ((ParentFSMExternalData *)_preloadIn((FSM *)pFSM)) /**< @deprecated 暂时弃用 */
|
||
|
||
typedef struct ParentFSMData
|
||
{
|
||
ParentFSMExternalData external;
|
||
ParentFSMInnerData internal;
|
||
}ParentFSMData;
|
||
|
||
typedef struct ParentFSM ParentFSM;
|
||
ParentFSM *createParentFSM();
|
||
|
||
|
||
|
||
|
||
#endif
|