FSM/vscode/FSM_OOP/template/templateFSM.h

58 lines
1.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __TEMPLATE_FSM_H_
#define __TEMPLATE_FSM_H_
/* -------------------------------------------------------------------------- */
/* 提前做类型声明 */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* 自定义数据和信号 */
/* -------------------------------------------------------------------------- */
/**
* @brief 自定义外部信号目前最多15个
*
*/
enum TemplateFSMSignals{
Signal_A = 1, /**< 必须从1开始0预留给Idle信号了*/
Signal_B,
};
/**
* @brief 自定义外部数据
*
*/
typedef struct TemplateFSMExternalData
{
int arrindex;
int x;
}TemplateFSMExternalData;
/**
* @brief 自定义内部数据
*
*/
typedef struct TemplateFSMInnerData
{
int y1;
int inner1;
}TemplateFSMInnerData;
/* -------------------------------------------------------------------------- */
/* 下面的改个名字就行了 */
/* -------------------------------------------------------------------------- */
#define TemplateFSM_Input(pFSM) ((TemplateFSMExternalData *)_preloadIn((FSM *)pFSM)) /**< @deprecated 暂时弃用 */
typedef struct TemplateFSMData
{
TemplateFSMExternalData external;
TemplateFSMInnerData internal;
}TemplateFSMData;
typedef struct TemplateFSM TemplateFSM;
TemplateFSM *createTemplateFSM();
#endif