基于C8051F的AD UART0 KEY FLASH TIME3程序
if(BGset>
if(k>
if(Page>
if(!(Mkey&0x08)) //SW5按下吗?右移->
if(direction >
if(keybuffer[0]>
if(Tset>
if(keybuffer[1]>
if(Tset>
if(keybuffer[2]>
if(Tset>
if(keybuffer[3]>
if(Tset>
if(keybuffer[4]>
if(Tset>
if(keybuffer[5]>
if(Tset>
Between[18] = PC1>>
Between[18] = PF1>>
if(PdownCount >
Between[18] = PC1>>
if(PdownCount >
Between[18] = PF1>>
if((CPT_c[0]>99)||(CPT_c[1]>12)||(CPT_c[2]>
if((CPT_c[3]>99)||(CPT_c[4]>12)||(CPT_c[5]>
if((CPT_c[6]>99)||(CPT_c[7]>12)||(CPT_c[8]>
if((FPT_c[0]>99)||(FPT_c[1]>12)||(FPT_c[2]>
_disp (1,0,0x94,1,0xd4,0xc2); //月
TH = FPT_c[2]/10;
TL = FPT_c[2]%10;
number_disp (1,0,0x95,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x96,1,0xc8,0xd5); //日
PDIS = FPT_c[12];
PDIS = PDIS<8 + FPT_c[13];
Pchange(PDIS);
number_disp (1,0,0x98,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x99,1,TAB[TT1],TAB[TT2]);
number_disp (1,0,0x9A,1,0x2e,TAB[TT3]);
number_disp (1,0,0x9B,1,0x4b,0x57);
}
//第2条信息
if((FPT_c[3]>99)||(FPT_c[4]>12)||(FPT_c[5]>31))
{
string_disp (0,1,0x80,8,tab9); //如果读取时间不对,显示“暂无记录”
}
else
{
number_disp (0,1,0x80,1,0x32,0x30); //0送显示
TH = FPT_c[3]/10;
TL = FPT_c[3]%10;
number_disp (0,1,0x81,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x82,1,0xc4,0xea); //年
TH = FPT_c[4]/10;
TL = FPT_c[4]%10;
number_disp (0,1,0x83,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x84,1,0xd4,0xc2); //月
TH = FPT_c[5]/10;
TL = FPT_c[5]%10;
number_disp (0,1,0x85,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x86,1,0xc8,0xd5); //日
PDIS = FPT_c[14];
PDIS = PDIS<8 + FPT_c[15];
Pchange(PDIS);
number_disp (0,1,0x88,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x89,1,TAB[TT1],TAB[TT2]);
number_disp (0,1,0x8A,1,0x2e,TAB[TT3]);
number_disp (0,1,0x8B,1,0x4b,0x57);
}
//第3条信息
if((FPT_c[6]>99)||(FPT_c[7]>12)||(FPT_c[8]>31))
{
string_disp (0,1,0x90,8,tab9);
}
else
{
number_disp (0,1,0x90,1,0x32,0x30); //0送显示
TH = FPT_c[6]/10;
TL = FPT_c[6]%10;
number_disp (0,1,0x91,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x92,1,0xc4,0xea); //年
TH = FPT_c[7]/10;
TL = FPT_c[7]%10;
number_disp (0,1,0x93,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x94,1,0xd4,0xc2); //月
TH = FPT_c[8]/10;
TL = FPT_c[8]%10;
number_disp (0,1,0x95,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x96,1,0xc8,0xd5);
PDIS = FPT_c[16];
PDIS = PDIS<8 + FPT_c[17];
Pchange(PDIS);
number_disp (0,1,0x98,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x99,1,TAB[TT1],TAB[TT2]);
number_disp (0,1,0x9A,1,0x2e,TAB[TT3]);
number_disp (0,1,0x9B,1,0x4b,0x57);
}
Page1=Page;
}break;
case 5: //显示当前时间
{
string_disp (1,0,0x80,10,tab7);
number_disp (1,0,0x90,1,0x32,0x30); //0送显示
TH = time_buf1[1]/10;
TL = time_buf1[1]%10;
number_disp (1,0,0x91,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x92,1,0xc4,0xea); //年
TH = time_buf1[2]/10;
TL = time_buf1[2]%10;
number_disp (1,0,0x93,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x94,1,0xd4,0xc2); //月
TH = time_buf1[3]/10;
TL = time_buf1[3]%10;
number_disp (1,0,0x95,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x96,1,0xc8,0xd5); //日
TH = time_buf1[4]/10;
TL = time_buf1[4]%10;
number_disp (0,1,0x85,1,TAB[TH],TAB[TL]); //
number_disp (0,1,0x86,1,0xca,0xb1); //时
TH = time_buf1[5]/10;
TL = time_buf1[5]%10;
number_disp (0,1,0x87,1,TAB[TH],TAB[TL]);
number_disp (0,1,0x88,1,0xb7,0xd6); //分
TH = time_buf1[6]/10;
TL = time_buf1[6]%10;
number_disp (0,1,0x89,1,TAB[TH],TAB[TL]); //
number_disp (0,1,0x8a,1,0xc3,0xeb); //秒
Page1=Page;
}break;
case 6: //修改时间
{
if(!set) //没有按SET键
{
string_disp (1,0,0x80,10,tab8);
number_disp (1,0,0x90,1,0x32,0x30); //0送显示
TH = time_buf1[1]/10;
TL = time_buf1[1]%10;
number_disp (1,0,0x91,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x92,1,0xc4,0xea); //年
TH = time_buf1[2]/10;
TL = time_buf1[2]%10;
number_disp (1,0,0x93,1,TAB[TH],TAB[TL]);
number_disp (1,0,0x94,1,0xd4,0xc2); //月
TH = time_b
C8051FADUART0TIME 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)