您好
我遇到了一些中断问题。
使用以下代码、不会触发我的中断函数。
(按钮被拉至高电平、按下时应变为0、这通过示波器进行确认)
如果我更改所有内容以进行轮询(在 while 循环中读取引脚)、我可以看到正确的值。
我怀疑我的代码有问题。
("print"函数是在我们的代码中有效使用多次且运行正常的函数)
void setup_rst()
{
GPIOPinTypeGPIOInput(GPIO_PORTC_BASE, GPIO_INT_PIN_5);
GPIOIntClear(GPIO_PORTC_BASE, GPIO_INT_PIN_5);
GPIOIntRegisterPin(GPIO_PORTC_BASE, GPIO_INT_PIN_5, rst_btn_pressed);
GPIOIntTypeSet(GPIO_PORTC_BASE, GPIO_INT_PIN_5, GPIO_FALLING_EDGE);
GPIOIntEnable(GPIO_PORTC_BASE, GPIO_PIN_5);
}
void rst_btn_pressed()
{
print((uint8_t *) "rst pressed\r\n");
}
