我在做开发板的中断部分学习,在中断源配置上有问题:例如按键1接的是GPIOA的PIN3,按键2接在GPIOD的PIN3,那么我在设置中断源的时候可以把他们分别设置中断线3和中断线4上吗?可我试过了,按键1,和按键2都没有反应,大家帮忙看看是哪里的问题.
#define KEY1_INT_GPIO_PORT GPIOA
#define KEY1_INT_GPIO_CLK (RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO)
#define KEY1_INT_GPIO_PIN GPIO_Pin_3
#define KEY1_INT_EXTI_PORTSOURCE EXTI_PortSourceGPIOA
#define KEY1_INT_EXTI_PINSOURCE EXTI_PinSource3
#define KEY1_INT_EXTI_LINE EXTI_Line3
#define KEY1_INT_EXTI_IRQ EXTI3_IRQn
#define KEY1_IRQHandler EXTI3_IRQHandler
#define KEY2_INT_GPIO_PORT GPIOD
#define KEY2_INT_GPIO_CLK (RCC_APB2Periph_GPIOC|RCC_APB2Periph_AFIO)
#define KEY2_INT_GPIO_PIN GPIO_Pin_3
#define KEY2_INT_EXTI_PORTSOURCE EXTI_PortSourceGPIOD
#define KEY2_INT_EXTI_PINSOURCE EXTI_PinSource3
#define KEY2_INT_EXTI_LINE EXTI_Line4
#define KEY2_INT_EXTI_IRQ EXTI4_IRQn
#define KEY2_IRQHandler EXTI4_IRQHandler
|