只是验证程序,啥都没干
void t0_int() interrupt 1
{
cnt0++;
//GPIO输出方波,验证周期
P35=!P35;
}
void t1_int() interrupt 3
{
cnt1++;
//GPIO输出方波,验证周期
P36=!P36;
}
//T2=1ms
//T2IF,STC8G硬件自动清零,STC8F需要软件清零,实际不清零也没有关系
//固定最低优先级
void t2_int() interrupt 12
{
static uchar t2_cnt;
static uchar t10ms;
AUXINTIF&=0xfe; //T2IF=0
t2_cnt++;
if(t2_cnt>=10)
{
t2_cnt=0;
t10ms++;
if(t10ms==100)
{
t10ms=0;
wdt_ok=1;
}
if(cnt2!=0) cnt2--;
}
//GPIO输出方波,验证周期
P37=!P37;
}
|