进不了中断啊
时间:10-02
整理:3721RD
点击:
void IntEnable(void)
{
rINTMOD&=~(BIT_TIMER0);
rINTMSK&=~(BIT_GLOBAL|BIT_TIMER0);
rINTCON=0x1;
}
void __irq Timer0_Int(void)
{
rI_ISPC=BIT_TIMER0;
Uart_Printf("中断来了");
}
void Timer_Int(void)
{
IntEnable();
pISR_TIMER0=(unsigned)Timer0_Int;
rTCFG0=0xff;
rTCFG1=0x0;
rTCNTB0=0xf000;
rTCMPB0=0x2000;
rTCON=0x6;
Delay(10);
rTCON=0x9;
}
为什么进不了中断函数啊(就是终端上不出现“中断来了”)
{
rINTMOD&=~(BIT_TIMER0);
rINTMSK&=~(BIT_GLOBAL|BIT_TIMER0);
rINTCON=0x1;
}
void __irq Timer0_Int(void)
{
rI_ISPC=BIT_TIMER0;
Uart_Printf("中断来了");
}
void Timer_Int(void)
{
IntEnable();
pISR_TIMER0=(unsigned)Timer0_Int;
rTCFG0=0xff;
rTCFG1=0x0;
rTCNTB0=0xf000;
rTCMPB0=0x2000;
rTCON=0x6;
Delay(10);
rTCON=0x9;
}
为什么进不了中断函数啊(就是终端上不出现“中断来了”)
你没加 关键字 interrupt 和中断序号 当然进不了终端