怎么查询呢INTERRUPT_HANDLER(EXTI_PORTE_IRQHandler, 7)
{
/* In order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction.
*/
EXTI_Sensitivity_TypeDef Keyexti_Sensitivity_Type;
/*
* 我们需要知道的信息是:
* 哪个引脚,发生哪个中断
*/
Keyexti_Sensitivity_Type = EXTI_GetExtIntSensitivity(EXTI_PORT_GPIOE);
switch (Keyexti_Sensitivity_Type) /* 得到当前发生的是哪种中断类型 */
{
case EXTI_SENSITIVITY_FALL_LOW : /* 低电平触发 */
//if (!GPIO_ReadInputPin(KEY_PORTE, KEY_2)) {
// LED_Reverse(LED_2);
// }
break;
case EXTI_SENSITIVITY_RISE_ONLY : /* 上升沿触发 */
/* 判断是哪个引脚发生外部中断 */
if (!GPIO_ReadInputPin(KEY_PORTE, KEY_2)) {
LED_Reverse(LED_2);
}
break;
case EXTI_SENSITIVITY_FALL_ONLY : /* 下降沿触发 */
/* 判断是哪个引脚发生外部中断 */
//if (!GPIO_ReadInputPin(KEY_PORTE, KEY_2)) {
// LED_Reverse(LED_2);
//}
break;
case EXTI_SENSITIVITY_RISE_FALL : /* 高电平触发 */
//if (!GPIO_ReadInputPin(KEY_PORTE, KEY_2)) {
// LED_Reverse(LED_2);
// }
break;
default:
break;
}
} |