typedef enum PageName
{ None,Main1,Main2,Warning,
Menu,RealTime,ParameterSet,ManualControl,ParameterVisit,StatueInformation,
HistroyRecords,RealTime_AC,RealTime_Battery,RealTimeIsolation,
RealTime_Model,RealTime_MotherLine,Disp_RealTime_Other
} PageName_T ;
方式 1:在结构体中加入枚举类型
typedef struct
{
PageName_T PageIndex;
PageName_T KeyA1Jump;
PageName_T KeyA2Jump;
PageName_T KeyA3Jump;
PageName_T KeyA4Jump;
}PageOperate_T;
PageOperate_T PageOperateArray[]=
{
None,None,None,None,None,
Warning,Warning,Main1,Menu,None,
Main1,None,Warning,Menu,Main2,
Main2,Main1,Warning,Menu,None
}
方式2 : 在结构体中加入 普通数据类型如 unsigned char
也可以将枚举值赋给它
typedef struct
{
//枚举-当前页面序号
unsigned char PageIndex;
//枚举-页面跳转序号
unsigned char KeyA1JumpPage;
unsigned char KeyA2JumpPage;
unsigned char KeyA3JumpPage;
unsigned char KeyA4JumpPage;
}PageOperate_II;
PageOperate_II PageOperateArray[]=
{
None,None,None,None,None,
Warning,Warning,Main1,Menu,None,
Main1,None,Warning,Menu,Main2,
Main2,Main1,Warning,Menu,None
};
文章评论(0条评论)
登录后参与讨论