我想用所有除了WAKEUP以外的按钮来进行控制.但是搞了半天都无法让TAMPER按钮和摇杆的右键正常被辨识.问题出在于两个都同在EXTI_Line13上 只是不同的GPIO群组.
目前我是用以下的方式来判断中断,不知道有谁比较有经验能教教我么判断到底是哪个按钮触发了中断?
if(EXTI_GetITStatus(TAMPER_BUTTON_EXTI_LINE) != RESET && !STM_EVAL_PBGetState(Button_TAMPER)){
...
EXTI_ClearITPendingBit(TAMPER_BUTTON_EXTI_LINE);
}else if(EXTI_GetITStatus(RIGHT_BUTTON_EXTI_LINE) != RESET){
...
EXTI_ClearITPendingBit(RIGHT_BUTTON_EXTI_LINE);
}
#define TAMPER_BUTTON_PORT GPIOC
#define TAMPER_BUTTON_CLK RCC_APB2Periph_GPIOC
#define TAMPER_BUTTON_PIN GPIO_Pin_13
#define TAMPER_BUTTON_EXTI_LINE EXTI_Line13
#define TAMPER_BUTTON_PORT_SOURCE GPIO_PortSourceGPIOC
#define TAMPER_BUTTON_PIN_SOURCE GPIO_PinSource13
#define TAMPER_BUTTON_IRQn EXTI15_10_IRQn
#define RIGHT_BUTTON_PORT GPIOG
#define RIGHT_BUTTON_CLK RCC_APB2Periph_GPIOG
#define RIGHT_BUTTON_PIN GPIO_Pin_13
#define RIGHT_BUTTON_EXTI_LINE EXTI_Line13
#define RIGHT_BUTTON_PORT_SOURCE GPIO_PortSourceGPIOG
#define RIGHT_BUTTON_PIN_SOURCE GPIO_PinSource13
#define RIGHT_BUTTON_IRQn EXTI15_10_IRQn |