触发了一次外部中断,在中断子程序中我把外部中断屏蔽了,但是 程序不退出中断子程序,一直停在判断是否发生中的的程序中(下面的程序,是在stm32f10x_exit.c中的子程序), ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) { ITStatus bitstatus = RESET; uint32_t enablestatus = 0; /* Check the parameters */ assert_param(IS_GET_EXTI_LINE(EXTI_Line)); enablestatus = EXTI->IMR & EXTI_Line; if (((EXTI->R & EXTI_Line) != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET)) { bitstatus = SET; } else { bitstatus = RESET; } return bitstatus; } |
RE:为什么程序一直停在stm32f10x_exit.c中的判断中断程序中
RE:为什么程序一直停在stm32f10x_exit.c中的判断中断程序中
RE:为什么程序一直停在stm32f10x_exit.c中的判断中断程序中
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB| RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD, ENABLE);
//启动AFIO
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
EXTI_InitTypeDef EXTI_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; // 抢占优先级别1
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; //响应优先级别1
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA,GPIO_PinSource15);/*将EXTI线15连接到PA15*/
EXTI_InitStructure.EXTI_Line = EXTI_Line15; /* 将中断映射到中断/事件源Line15 */
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; /* 中断模式 */
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;/* 上升沿触发 */
EXTI_InitStructure.EXTI_LineCmd = ENABLE; /* 中断使能,即开中断 */
EXTI_Init(&EXTI_InitStructure);
void EXTI15_10_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line15)!=RESET)
{
EXITFlag=1;
GPIO_SetBits(GPIOB,GPIO_Pin_13);
GPIO_SetBits(GPIOB,GPIO_Pin_12);
EXTI_ClearITPendingBit(EXTI_Line15);
EXTI->IMR &= 0x0000;
}
}
RE:为什么程序一直停在stm32f10x_exit.c中的判断中断程序中