int main()
{
typedef struct
{
u8 KeyCurrentIndex;//当前状态索引号
u8 KeyEnterState;//按下【enter】键时转向的索引号
u8 KeyCancelState;//按下【cancel】键时转向的索引号
u8 KeyUpState;//按下【up】键时转向的索引号
u8 KeyDownState;//按下【down】键时转向的索引号
void (*CurrentOperate)(); //当前状态下执行的功能操作
}KbdTabStruct;
const KbdTabStruct KBD[]=
{
{0,1,2,3,4,(*main)},
{6,7,8,9,10,(*main)},
{0,1,2,3,4,,(*main)},
{0,1,2,3,4,(*main)},
};
printf("%d
",KBD[0].KeyCurrentIndex);
printf("%d
",KBD[0].KeyEnterState);
printf("%d
",KBD[0].KeyCancelState);
printf("%d
",KBD[0].KeyUpState);
printf("%d
",KBD[0].KeyDownState);
printf("%d
",KBD[1].KeyCurrentIndex);
printf("%d
",KBD[1].KeyEnterState);
printf("%d
",KBD[1].KeyCancelState);
printf("%d
",KBD[1].KeyUpState);
printf("%d
",KBD[1].KeyDownState);
printf("%5s
",KBD[0].CurrentOperate);
}
上一篇:单片机编译器中局部变量和全局变量的深入解析
下一篇:学习uip代码分析时遇到的c语言问题
推荐阅读最新更新时间:2024-03-16 14:32