华大HC32L110C6UA芯片配置P03端口输入下降沿中断,一旦触发中断就会一直进入端口中断,有对M0P_GPIO->P3ICLR写入0操作,并读取M0P_GPIO->P3ICLR和M0P_GPIO->P0STAT_f 寄存器发现值并没有变化。不知道是有哪里没有设置好,各位大神帮忙看看!如下是程序过程:
void Gpio_IRQHandler(uint8_t u8Param){
uint32_t read_stat=0;
switch(u8Param)
{
case 0:
{
}
break;
case 1:
{
}
break;
case 2:
{
}
break;
case 3:
{
}
break;
default:;
break;
}
*((uint32_t *)((uint32_t)&M0P_GPIO->P3ICLR + u8Param * 0x40)) = 0;
read_stat=*((uint32_t *)((uint32_t)&M0P_GPIO->P3ICLR + u8Param * 0x40));
read_stat=*((uint32_t *)((uint32_t)&M0P_GPIO->P0STAT_f + u8Param * 0x40));
}
int32_t main(void)
{
Gpio_InitIOExt(0, 3, GpioDirIn, FALSE, FALSE, FALSE, FALSE);
Gpio_ClearIrq(0, 3);
//上升沿
Gpio_EnableIrq(0, 3, GpioIrqFalling);
EnableNvic(PORT0_IRQn, DDL_IRQ_LEVEL_DEFAULT, TRUE);
while(1)
{
}
}
|