📄 timea.c
字号:
#include "f2407_c.h"
unsigned int time_cnt=0x0100; /*time1 1s count*/
extern unsigned int lcddata[0x250];
extern void timeA1_init(void)
{
*T1CON=0x170c; /*Time1 increase mode prescale=128*/
*GPTCONA=0x6000;
*EVAIMRA=*EVAIMRA|0x0080; /*enable Time1 period interrupt*/
*EVAIFRA=0xffff; /*clear Time1 period interrupt flag*/
*T1PR=0x00ea; /*1 period = 1ms*/
*T1CNT=0; /*Time1 clear*/
}
void interrupt inter2(void)
{
*IFR=0xffff;
*EVAIFRA=0xffff;
switch(*PIVR)
{
case 0x0027: /*time1 period interrupt*/
{
/* *T1CNT=0; */
time_cnt--;
if(!(time_cnt))
{
lcddata[0x200]++;
time_cnt=0x0100;
}
break;
}
default:;
}
enable();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -