static void show(void) { CounterBack=0; Vin_Set(VIN_SetCounter,1); }
static void keypress(unsigned int key) { switch(KeyValue) { case KeyValueMenu: pMenuItem=&Menu_0_loggingin; pMenuItem->show(); memset(Menu_Vin_Code,0,sizeof(Menu_Vin_Code)); VIN_SetFlag=1; VIN_SetCounter=0; break; case KeyValueOk: if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { Menu_Vin_Code[VIN_SetFlag-1]=ABC[VIN_SetCounter][0]; //rt_kprintf("\r\n VIN_set=%d,%s",VIN_SetFlag,Menu_Vin_Code); VIN_SetFlag++; VIN_SetCounter=0; Vin_Set(0,1); } else if(VIN_SetFlag==18) { //rt_kprintf("\r\n VIN_set=%d,%s(ok)",VIN_SetFlag,Menu_Vin_Code); VIN_SetFlag=19; lcd_fill(0); lcd_text12(0,5,(char *)Menu_Vin_Code,17,LCD_MODE_SET); lcd_text12(25,19,"VINÉèÖÃÍê³É",11,LCD_MODE_SET); lcd_update_all(); //rt_kprintf("\r\n VIN_set=%d,%s(ok--)",VIN_SetFlag,Menu_Vin_Code); } else if(VIN_SetFlag==19) { //rt_kprintf("\r\n VIN_set=%d,%s(return)",VIN_SetFlag,Menu_Vin_Code); VIN_SetFlag=1; CarSet_0_counter=5; pMenuItem=&Menu_0_loggingin; pMenuItem->show(); } break; case KeyValueUP: if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { if(VIN_SetCounter==0) VIN_SetCounter=35; else if(VIN_SetCounter>=1) VIN_SetCounter--; if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1); else Vin_Set(VIN_SetCounter,2); } break; case KeyValueDown: if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { VIN_SetCounter++; if(VIN_SetCounter>35) VIN_SetCounter=0; if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1); else Vin_Set(VIN_SetCounter,2); } break; } KeyValue=0; }
static void keypress(unsigned int key) { switch(key) { case KEY_MENU: if(VIN_Modify_Flag==1)//有字符需要修改 { if(VIN_SetFlag==18) { pMenuItem=&Menu_0_loggingin; pMenuItem->show(); memset(Menu_Vin_Code,0,sizeof(Menu_Vin_Code)); VIN_SetFlag=1; VIN_SetCounter=0; VIN_Modify_Flag=0; VIN_SetFlag_Temp=1; } else { VIN_Modify_Flag=2;//选择需要修改的字符 VIN_SetFlag_Temp=VIN_SetFlag; Vin_Set(VIN_SetCounter,1,1); } //rt_kprintf("\r\n按 菜单键 修改"); } else { pMenuItem=&Menu_0_loggingin; pMenuItem->show(); memset(Menu_Vin_Code,0,sizeof(Menu_Vin_Code)); VIN_SetFlag=1; VIN_SetCounter=0; } break; case KEY_OK: if(VIN_Modify_Flag==2) { VIN_Modify_Flag=3; Vin_Set(VIN_SetCounter,1,2); } else if(VIN_Modify_Flag==3) { //if(VIN_SetCounter<=9) Menu_Vin_Code[VIN_SetFlag_Temp-2]=ABC[VIN_SetCounter][0];//VIN_SetCounter+'0'; Vin_Set(0,1,0); //rt_kprintf("\r\n 单字符修改完成 Sim_SetFlag_temp = %d "); VIN_Modify_Flag=1; VIN_SetCounter=0; } else { if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { Menu_Vin_Code[VIN_SetFlag-1]=ABC[VIN_SetCounter][0]; //rt_kprintf("\r\n VIN_set=%d,%s",VIN_SetFlag,Menu_Vin_Code); VIN_SetFlag++; VIN_SetCounter=0; Vin_Set(0,1,0); VIN_Modify_Flag=1; } if(VIN_SetFlag==18) { //rt_kprintf("\r\n VIN_set=%d,%s(ok)",VIN_SetFlag,Menu_Vin_Code); VIN_SetFlag=19; if(MENU_set_carinfor_flag==1) { //车辆VIN memset(jt808_param.id_0xF005,0,sizeof(jt808_param.id_0xF005)); memcpy(jt808_param.id_0xF005,Menu_Vin_Code,17); param_save(1); //rt_kprintf("\r\nVIN 设置完成,按菜单键返回,%s",Menu_Vin_Code); } lcd_fill(0); lcd_text12(0,5,(char *)Menu_Vin_Code,17,LCD_MODE_SET); lcd_text12(25,19,"VIN设置完成",11,LCD_MODE_SET); lcd_update_all(); //rt_kprintf("\r\n VIN_set=%d,%s(ok--)",VIN_SetFlag,Menu_Vin_Code); } else if(VIN_SetFlag==19) { VIN_SetFlag=1; CarSet_0_counter=5; pMenuItem=&Menu_0_loggingin; pMenuItem->show(); } } break; case KEY_UP: if(VIN_Modify_Flag==2) { if(VIN_SetFlag_Temp>2) VIN_SetFlag_Temp--; //rt_kprintf("\r\n Sim_SetFlag_temp=%d",Sim_SetFlag_temp); Vin_Set(VIN_SetCounter,1,1); } else { if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { if(VIN_SetCounter==0) VIN_SetCounter=35; else if(VIN_SetCounter>=1) VIN_SetCounter--; if(VIN_Modify_Flag==3) { if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1,2); else Vin_Set(VIN_SetCounter,2,2); } else { if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1,0); else Vin_Set(VIN_SetCounter,2,0); } } } break; case KEY_DOWN: //选择需要修改的字符 if(VIN_Modify_Flag==2) { if(VIN_SetFlag_Temp<VIN_SetFlag) VIN_SetFlag_Temp++; //rt_kprintf("\r\n Sim_SetFlag_temp=%d",Sim_SetFlag_temp); Vin_Set(VIN_SetCounter,1,1); } else { if((VIN_SetFlag>=1)&&(VIN_SetFlag<=17)) { VIN_SetCounter++; if(VIN_SetCounter>35) VIN_SetCounter=0; if(VIN_Modify_Flag==3) { if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1,2); else Vin_Set(VIN_SetCounter,2,2); } else { if(VIN_SetCounter<20) Vin_Set(VIN_SetCounter,1,0); else Vin_Set(VIN_SetCounter,2,0); } } } break; } KeyValue=0; }