📄 time.h
字号:
void SET_time(void)
{
PREINT=(11059200/32768)-1;
PREFRAC=11059200-((PREINT+1)*32768);
CCR=0x00;
YEAR=2000;
MONTH=1;
DOM=1;
DOY=1;
DOW=6;
HOUR=9;
MIN=0;
SEC=46;
CIIR=0x00;
AMR=0xff;
CCR=0x01;
}
void show_time(void)
{
U32 times,days,mms,show;
times=CTIME0;
days=CTIME1;
mms=CTIME2;
show=times&0x3f;
LCD_show_time(show%10,4,88);
//show=times&0x3f;
LCD_show_time(show/10,4,80);
show=(times>>8)&0x3f;
LCD_show_time(show%10,4,64);
//show=(times>>8)&0x3f;
LCD_show_time(show/10,4,56);
show=(times>>16)&0x1f;
LCD_show_time(show%10,4,40);
//show=(times>>16)&0x1f;
LCD_show_time(show/10,4,32);
show=(times>>24)&0x07;
switch(show)
{case 0:LCD_show_word(15,2,72);break;
case 1:LCD_show_word(21,2,72);break;
case 2:LCD_show_word(23,2,72);break;
case 3:LCD_show_word(25,2,72);break;
case 4:LCD_show_word(27,2,72);break;
case 5:LCD_show_word(29,2,72);break;
case 6:LCD_show_word(31,2,72);break;
}
show=days&0x1f;
LCD_show_time(show%10,0,96);
//show=days&0x1f;
LCD_show_time(show/10,0,88);
show=(days>>8)&0x0f;
LCD_show_time(show%10,0,64);
//show=(days>>8)&0x0f;
LCD_show_time(show/10,0,56);
show=(days>>16)&0x0fff;
LCD_show_time(show%1000%100%10,0,32);
//show=(days>>16)&0x0fff;
LCD_show_time(show%1000%100/10,0,24);
//show=(days>>16)&0x0fff;
LCD_show_time(show%1000/100,0,16);
//show=(days>>16)&0x0fff;
LCD_show_time(show/1000,0,8);
show=mms&0x0fff;
LCD_show_time(show%100%10,6,92);
//show=mms&0x0fff;
LCD_show_time(show%100/10,6,84);
// show=mms&0x0fff;
LCD_show_time(show/100,6,76);
}
void chinese_word(void)
{
LCD_show_word(11,0,40);
LCD_show_word(13,0,72);
LCD_show_word(15,0,104);
LCD_show_word(17,2,40);
LCD_show_word(19,2,56);
LCD_show_time(10,4,48);
LCD_show_time(10,4,72);
LCD_show_word(33,6,12);
LCD_show_word(11,6,28);
LCD_show_word(35,6,44);
LCD_show_word(37,6,60);
LCD_show_word(39,6,100);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -