datasheet
超过460,000+ 应用技术资源下载
null

万年历源码

  • 1星
  • 日期: 2015-08-10
  • 大小: 2.58KB
  • 所需积分:3分
  • 下载次数:0
  • favicon收藏
  • rep举报
  • 分享
  • free评论
标签: 万年历源码

万年历源码万年历源码万年历源码

#define Null 0 void NullSubs(void) { } code struct MenuItem MainMenu[7]; code struct MenuItem testMenu[6]; #define LcdMaxLine 2 struct MenuItem (*MenuPoint) = MainMenu; unsigned char DisplayStart=0; unsigned char UserChoose=0; unsigned char DisplayPoint=0; unsigned char MaxItems=0; bit ShowMenuFlag=0; struct MenuItem { unsigned char MenuCount; unsigned char *DisplayString; void (*Subs)(); struct MenuItem *ChildrenMenus; struct MenuItem *ParentMenus; }; code struct MenuItem MainMenu[7] = { {7,"Set Time ",NullSubs,testMenu,Null}, {7,"Set Alarm Time",NullSubs,Null,Null}, {7,"Alarm Swtich ",NullSubs,Null,Null}, {7,"Check Alarm ",NullSubs,Null,Null}, {7,"Alarm Init ",NullSubs,Null,Null}, {7,"Exit ",NullSubs,MainMenu,MainMenu}, {7,"test ",NullSubs,MainMenu,MainMenu} }; code struct MenuItem testMenu[6] = { {6,"matisha.lofter.com/",NullSubs,Null,MainMenu}, {6,"22222222222222",NullSubs,Null,MainMenu}, {6,"33333333333333",NullSubs,Null,MainMenu}, {6,"44444444444444",NullSubs,Null,MainMenu}, {6,"55555555555555",NullSubs,Null,MainMenu}, {6,"matisha.lofter.com/",NullSubs,Null,MainMenu} }; void ShowMenu(void) { unsigned char i = 0; MaxItems = MenuPoint[0].MenuCount; DisplayPoint = DisplayStart; for(i=0;i"); else LCD_Write_String(0,i," "); LCD_Write_String(2,i,MenuPoint[DisplayPoint++].DisplayString); }else { LCD_Write_String(2,LcdMaxLine-1," "); } } if(UserChoose%LcdMaxLine==0){ DisplayStart = UserChoose; }else{ for(i=0;i<=MaxItems;i++){ if(UserChoose!=(i%LcdMaxLine)) DisplayStart = UserChoose-1; } } } void ChangeMenu(unsigned char keynum) { switch(keynum){ case ADD: UserChoose--; if (UserChoose==255) { UserChoose = 0; } break; case SUB: UserChoose++; if (UserChoose == MaxItems) { UserChoose = MaxItems-1; } break; case ENTER: if (MenuPoint[UserChoose].Subs != NullSubs) { (*MenuPoint[UserChoose].Subs)(); } else if (MenuPoint[UserChoose].ChildrenMenus != Null) { MenuPoint = MenuPoint[UserChoose].ChildrenMenus; UserChoose = 0; DisplayStart = 0; } break; case SET: if (MenuPoint[UserChoose].ParentMenus != Null) { MenuPoint = MenuPoint[UserChoose].ParentMenus; UserChoose = 0; DisplayStart = 0; } break; default:break; } ShowMenu(); }
更多简介内容

评论

下载专区


TI最新应用解决方案

工业电子 汽车电子

$(function(){ var appid = $(".select li a").data("channel"); $(".select li a").click(function(){ var appid = $(this).data("channel"); $('.select dt').html($(this).html()); $('#channel').val(appid); }) })