做了一个按键程序,但是进不了中断,程序如下,希望大牛指出问题void EXIT_KEY_Init(void) { GPIO_InitTypeDef GPIO_InitStruct; EXTI_InitTypeDef EXTI_InitStruct; NVIC_InitTypeDef NVIC_InitStruct; /* config the extiline(PC2) clock*/ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE); /* Configyre P[A|B|C|D|E]0 NIVC */ NVIC_InitStruct.NVIC_IRQChannel = EXTI2_TS_IRQn; NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStruct.NVIC_IRQChannelSubPriority = 1; NVIC_InitStruct.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStruct); /* EXTI line gpio config(PC2) */ GPIO_InitStruct.GPIO_Pin = GPIO_Pin_2; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_UP; // GPIO_Init(GPIOC, &GPIO_InitStruct); /* EXTI line(PC2) mode config */ SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOC, EXTI_PinSource2); EXTI_InitStruct.EXTI_Line = EXTI_Line2; EXTI_InitStruct.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStruct.EXTI_Trigger = EXTI_Trigger_Falling; // EXTI_InitStruct.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStruct); } void EXTI2_TS_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line2) != RESET) { Delay(2000); if(EXTI_GetITStatus(EXTI_Line2) != RESET) / { EXTI_ClearITPendingBit(EXTI_Line2); LEDON; } } |
STM32F3 硬件I2C 驱动OLED 求助!!
STM32F303使用定时器触发双ADC常规同步采样模式
哪位大哥传下STM32F334 Nucleo的工程模板给我下
STM32F334 不能串口下载
关于STM32F334的HRTIM分辨率问题
STM32F303+LCD1602程序问题,不只为什么点不亮?
STM32F334的ADC使用问题
STM32F334 HRTIM形成移相全桥波形问题
有用过STM32F373VC的板子么 iic 例程不好使
STM32F3 ADC外部触发采样达不到7.2MSPS
配置了/* Enable SYSCFG clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);还是进不了中断,但是能进PC3的void EXTI3_IRQHandler(void)中断,void EXTI2_TS_IRQHandler(void)与void EXTI3_IRQHandler(void)有什么本质区别?