不管IO设置成上升沿还是下降沿触发,按键都只会在下降沿触发中断。而且打断点发现,不管什么触发方式,一次按键按下松开,均会导致两次进入中断。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
不管IO设置成上升沿还是下降沿触发,按键都只会在下降沿触发中断。而且打断点发现,不管什么触发方式,一次按键按下松开,均会导致两次进入中断。
应该不会。你是不是IO配置有问题。给你一个IO口配置,你可以参考一下。
/*****************************************************************************
接收使能中断
p0.0
******************************************************************************/
void RxEnableInterruptInit(void)
{
P0SEL &= ~BV(0);
P0DIR &= ~BV(0);
P0INP &= ~BV(0);
P0IEN |= BV(0); //中断使能
P2INP &= ~BV(5);//端口模式上拉
//PICTL &= ~(0x1 << 0);//上升沿中断改为下降沿
PICTL |= (0x1 << 0);
IEN1 |= (0x1 << 5);//端口0中断使能
P0IFG = 0;
P0IF = 0;
return;
}