这是在stm32f10x_it..c中的设置 void EXTI15_10_IRQHandler(void) { delay_ms(10); //按键消抖 if(EXTI_GetITStatus(EXTI_Line14) != RESET) { LCD_Clear(WHITE); LED2(0) ; } else if (EXTI_GetITStatus(EXTI_Line15) != RESET) { LCD_Clear(BLACK); LED2(1) ; } EXTI_ClearITPendingBit(EXTI_Line14); //清除EXTI13线路挂起位 EXTI_ClearITPendingBit(EXTI_Line15); //清除EXTI15线路挂起位 } 这是在exti.c中的设置 static void NVIC_Configuration(void) { NVIC_InitTypeDef NVIC_InitStructure; /* Configure one bit for preemption priority */ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); /* 配置P[A|B|C|D|E]5为中断源 */ NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); } void EXTI_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; EXTI_InitTypeDef EXTI_InitStructure; /* config the extiline(PB0) clock and AFIO clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_AFIO,ENABLE); /* config the NVIC(PB0) */ NVIC_Configuration(); /* EXTI line gpio config(PB0) */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14|GPIO_Pin_15; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD; // 上拉输入 GPIO_Init(GPIOA, &GPIO_InitStructure); /* EXTI line(PB0) mode config */ GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource14|GPIO_PinSource15); EXTI_InitStructure.EXTI_Line = EXTI_Line14|EXTI_Line15; EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling; //下降沿中断 EXTI_InitStructure.EXTI_LineCmd = ENABLE; EXTI_Init(&EXTI_InitStructure); } 问题: 外部中断EXTI_LINE13进不去?EXTI_LINE15却能..为什么呀?请各位能人解释一下,不胜感激! |
回复:外部中断EXTI_LINE13进不去?EXTI_LINE15却能..