可有人帮我分析一下关于开发板按键无法进入中断的原因?我在EXIT例程中可以正常进入中断,但是我修改了ALIENTEK_MiniSTM32_EVAL.h后就不能进入中断了。
以下为修改后的代码,我用地线触碰PC的2脚无法产生中断, 在我修改了stm32f10x_it.c中的EXTI15_10_IRQHandler(void)后以Button_KEY1为触发第一条件判断后可以用PC13产生中断
,这是为何一直无法用KEY0产生中断呢?
#define BUTTONn 3 /*!< Joystick pins are connected to an IO Expander (accessible through I2C1 interface) */
/*
// @brief KEY0
#define BUTTON0_PORT GPIOA
#define BUTTON0_CLK RCC_APB2Periph_GPIOA
#define BUTTON0_PIN GPIO_Pin_13
#define BUTTON0_EXTI_LINE EXTI_Line13
#define BUTTON0_PORT_SOURCE GPIO_PortSourceGPIOA
#define BUTTON0_PIN_SOURCE GPIO_PinSource13
#define BUTTON0_IRQn EXTI15_10_IRQn
//@brief KEY1
#define BUTTON1_PORT GPIOA
#define BUTTON1_CLK RCC_APB2Periph_GPIOA
#define BUTTON1_PIN GPIO_Pin_15
#define BUTTON1_EXTI_LINE EXTI_Line15
#define BUTTON1_PORT_SOURCE GPIO_PortSourceGPIOA
#define BUTTON1_PIN_SOURCE GPIO_PinSource15
#define BUTTON1_IRQn EXTI15_10_IRQn
*/
//KEY0 相当于A相
#define BUTTON0_PORT GPIOC
#define BUTTON0_CLK RCC_APB2Periph_GPIOC
#define BUTTON0_PIN GPIO_Pin_2
#define BUTTON0_EXTI_LINE EXTI_Line2
#define BUTTON0_PORT_SOURCE GPIO_PortSourceGPIOC
#define BUTTON0_PIN_SOURCE GPIO_PinSource2
#define BUTTON0_IRQn EXTI15_10_IRQn
//KEY1 相当于B相
#define BUTTON1_PORT GPIOC
#define BUTTON1_CLK RCC_APB2Periph_GPIOC
#define BUTTON1_PIN GPIO_Pin_13
#define BUTTON1_EXTI_LINE EXTI_Line13
#define BUTTON1_PORT_SOURCE GPIO_PortSourceGPIOC
#define BUTTON1_PIN_SOURCE GPIO_PinSource13
#define BUTTON1_IRQn EXTI15_10_IRQn
|