- 积分
- 8
贡献55
飞刀12 FD
注册时间2022-8-16
在线时间1 小时
![](data/attachment/common/c2/common_12_usergroup_icon.gif)
![i.MX RT通行证](static/image/common/medal1.gif)
扫一扫,手机访问本帖 ![](plugin.php?id=aboc_qrcode:aboc_qrcode&tid=94029)
|
我选取GPIO1.24(H13)和GPIO1.25(M13)来进行测试,不会进入中断,帮我看看是哪里的问题。我用GPIO1.3(G11)也都没问题的。我是在GPIO口的中断例程中更改的。
配置:
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_03_GPIO1_IO03, 0U);
// IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_08_GPIO1_IO24, 0U); /* GPIO_AD_B1_08(H13) is configured as 输入中断 */
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_09_GPIO1_IO25, 0U);
main.c文件中:
这个0-15的中断可以进入
void GPIO1_Combined_0_15_IRQHandler(void)
{
/* clear the interrupt status */
GPIO_PortClearInterruptFlags(GPIO1, 1U << 3);
/* Change state of switch. */
g_InputSignal = true;
/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
}
这个中断一直不会进来
void GPIO1_Combined_16_31_IRQHandler(void)
{
/* clear the interrupt status */
GPIO_PortClearInterruptFlags(GPIO1, 1U << 25);
/* Change state of switch. */
g_InputSignal = true;
/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
__DSB();
#endif
}
主函数中的初始化:
/* Define the init structure for the input switch pin */
gpio_pin_config_t sw_config = {
kGPIO_DigitalInput,
0,
kGPIO_IntRisingEdge,
};
/* Init input switch GPIO. */
EnableIRQ(EXAMPLE_SW_IRQ);
GPIO_PinInit(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN, &sw_config);
/* Enable GPIO pin interrupt */
GPIO_PortEnableInterrupts(EXAMPLE_SW_GPIO, 1U << EXAMPLE_SW_GPIO_PIN);//这里是GPIO1.3
/* Init input switch GPIO. */
EnableIRQ(GPIO1_Combined_0_15_IRQn);
GPIO_PinInit(GPIO1, 3U, &sw_config);
/* Enable GPIO pin interrupt */
GPIO_PortEnableInterrupts(GPIO1, 1U << 3);
/* Init input switch GPIO. */
EnableIRQ(GPIO1_Combined_16_31_IRQn);
GPIO_PinInit(GPIO1, 25U, &sw_config);
/* Enable GPIO pin interrupt */
GPIO_PortEnableInterrupts(GPIO1, 1U << 25);
有人用过这个GPIO1的16-31中断的吗?帮我看看问题出在哪里,我用相同的方式GPIO1的0-15的可以触发
|
|