如题,我将中断触发方式改成下降沿触发,为什么按下键后中断程序运行了两次,就是用Uart_Printf函数提示某某键按下了,放开也是一样,这是怎么回事?程序如下
在中断程序中加了延时也不行。

static void __irq Key_ISR(void)
{
U8 key;
U32 r;
int i,j;
Delay(100); //加在这个地方
EnterCritical(&r);
if(rINTPND==BIT_EINT8_23) {
ClearPending(BIT_EINT8_23);
if(rEINTPEND&(1<<8)) {
//Uart_Printf("eint11\n");
rEINTPEND |= 1<< 8;
}
if(rEINTPEND&(1<<11)) {
//Uart_Printf("eint11\n");
rEINTPEND |= 1<< 11;
}
if(rEINTPEND&(1<<13)) {
//Uart_Printf("eint11\n");
rEINTPEND |= 1<< 13;
}
if(rEINTPEND&(1<<14)) {
//Uart_Printf("eint11\n");
rEINTPEND |= 1<< 14;
}
if(rEINTPEND&(1<<15)) {
//Uart_Printf("eint11\n");
rEINTPEND |= 1<< 15;
}
if(rEINTPEND&(1<<19)) {
// Uart_Printf("eint19\n");
rEINTPEND |= 1<< 19;
}
}
key=Key_Scan();
if( key == 0xff )
Uart_Printf( "Interrupt occur... Key is released!\n") ;
else
Uart_Printf( "Interrupt occur... K%d is pressed!\n", key) ;
ExitCritical(&r);
}