📄 timer.c
字号:
#include "typedef.h"
#include "time.h"
#include "ll.h"
unsigned char prgCnt = 0;
void time(void) interrupt 1 using 2
{
// TH0=0x82; //10ms的基准定时,40M
// TL0=0x35;
TH0=0xdc; //10ms的基准定时,11.0592M
TL0=0x00;
prgCnt ++; //prg run
pwUpScanCnt ++;
if(b_spker)spkerCnt++;
if(b_com_r6c)
{
timeout --;
if(timeout==0)
{
TIMERINT=1;
b_com_r6c=0;
}
}
}
/**************************************************************/
BOOL _setTimer(uchar timeout_temp)
{
b_com_r6c = 1;
timeout = timeout_temp;
TIMERINT= 0;
TR0 = 1;
return(TRUE);
}
void _clrTimer(void)
{
b_com_r6c = 0;
timeout = 0;
TIMERINT = 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -