PIC16只有一个中断向量。所以,必须是在中断响应程序里查找哪个中断标志有了。那个中断函数的名称没意义。
请找实际例程看看去。比如这个:
static void interrupt
isr(void) // Here be interrupt function - the name is unimportant.
{
if (T0IF) {
T0IF = 0; // clear the interrupt flag
}
else if(TMR1IF) {
TMR1IF = 0; // clear the interrupt flag
}
else if(RBIF)
{RBIF=0;
}
}
PIC16只有一个中断向量。所以,必须是在中断响应程序里查找哪个中断标志有了。那个中断函数的名称没意义。
请找实际例程看看去。比如这个:
static void interrupt
isr(void) // Here be interrupt function - the name is unimportant.
{
if (T0IF) {
T0IF = 0; // clear the interrupt flag
}
else if(TMR1IF) {
TMR1IF = 0; // clear the interrupt flag
}
else if(RBIF)
{RBIF=0;
}
}
举报