t0.c
来自「16C554VX1128MAX4359-MAX4456P89LPC952 驱动」· C语言 代码 · 共 36 行
C
36 行
#include <REG952.H>
#define uchar unsigned char
#define uint unsigned int
uchar over=0;
void T0_init(void)
{
TMOD=0x01; //模式1
TAMOD=0x00;
TH0=0x00; // 11.8ms
TL0=0x00;
ET0=1; //T0开中断
// TR0=1;
}
/*
void Delay_N_Second(uchar n)
{
uint j;
for(;n>0;n--)
for(j=0;j<22222;j++)
{
while(!TF0);
TF0=0;
}
}
*/
void T0_int(void) interrupt 1 using 2
{
EA=0;
TR0=0;
over=1;
EA=1;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?