FSM/vscode/FSM_OOP/childtest/parentFSM.h

64 lines
1.6 KiB
C
Raw Normal View History

2024-01-30 15:50:34 +08:00
#ifndef __PARENT_FSM_H_
#define __PARENT_FSM_H_
2024-06-26 20:21:14 +08:00
/* -------------------------------------------------------------------------- */
/* 提前做类型声明 */
/* -------------------------------------------------------------------------- */
2024-01-30 15:50:34 +08:00
2024-06-26 20:21:14 +08:00
/* -------------------------------------------------------------------------- */
/* 自定义数据和信号 */
/* -------------------------------------------------------------------------- */
/**
* @brief 15
* @details Unint16存储的信号位
*
*/
enum ParentFSMSignals{
Signal_toA = 1, /**< 必须从1开始0预留给Idle信号了*/
Signal_toB,
Signal_toC,
};
/**
* @brief
*
*/
typedef struct ParentFSMExternalData
2024-01-30 15:50:34 +08:00
{
int arrindex;
2024-06-26 20:21:14 +08:00
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;
2024-01-30 15:50:34 +08:00
}ParentFSMData;
2024-06-26 20:21:14 +08:00
typedef struct ParentFSM ParentFSM;
2024-01-30 15:50:34 +08:00
ParentFSM *createParentFSM();
2024-06-26 20:21:14 +08:00
2024-01-30 15:50:34 +08:00
#endif