配置代码有问题吗?
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE | RCC_APB2Periph_AFIO, ENABLE);
GPIO_EXTILineConfig(GPIO_PortSourceGPIOE, GPIO_PinSource2);
EXTI_DeInit();
EXTI_initstructure.EXTI_Line = EXTI_Line2; //中断线2
EXTI_initstructure.EXTI_Mode = EXTI_Mode_Event; //使用事件模式
EXTI_initstructure.EXTI_Trigger = EXTI_Trigger_Falling; //下降沿触发
EXTI_initstructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_initstructure);
|