MA82G5B32为什么会这样?
只要启用这行
EIE1 |= EKB;
此行会导致无法进入定时器0中断
关掉这行定时器0正常进中断
void EnableKBIInterrup()
{
EIE1 |= EKB;//此行会导致无法进入定时器中断
KBPATN = 0xFF;
KBCON = 0;
KBMASK |= (0x01 << 4);//启动p2.2:kbi4键盘中断//
}
void KBI_ISR(void) interrupt 7
{
KBCON = 0;
KBMASK = 0;
}
void Timer0_Init(void)
{
AUXR0 |= T0XL;
AUXR2 &= ~T0X12;
AUXR2 &= 0xFE;
TMOD&=0XF0;
TMOD|=0X01;
TH0=0;
TL0=0;
ET0=1;
TF0 = 0;
TR0=1;
}
//定时器0中断服务程序
void Timer0_ISR(void) interrupt 1
{
TF0 = 0;
TH0=0xff;
TL0=0xff;
} |