外部中断配置如下,配置完成中断函数无法进去 /*----------------------------------------------------------- Function: Input: Output: Description:外部中断配置 -------------------------------------------------------------*/ void Exit_Config(void) { NVIC_InitTypeDef NVIC_InitStructure; EXTI_InitTypeDef EXTI_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);//使能SYSCFG时钟 RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); /* Configure PC3 pin as input floating */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOC, &GPIO_InitStructure); SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOC, EXTI_PinSource3); EXTI_InitStructure.EXTI_Line = EXTI_Line3; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_LineCmd = EXTI_Trigger_Falling; EXTI_InitStructure.EXTI_Trigger = ENABLE; EXTI_Init(&EXTI_InitStructure); //初始化外设EXTI寄存器 NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); NVIC_InitStructure.NVIC_IRQChannel = EXTI3_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); EN_CCWAKE_INT; EXTI->IMR |= (EXTI_Line3 ); EXTI_ClearITPendingBit(EXTI_Line3); // EXTI_GenerateSWInterrupt(EXTI_Line3); } |
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
评分
查看全部评分
EXTI_InitStructure.EXTI_Line = EXTI_Line8;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
评分
查看全部评分