void EXTI0_IRQHandler(void) { if(EXTI_GetITStatus(EXTI_Line0) != RESET) //确认是否产生中断 { Delay_ms(1000); GPIOB->ODR ^=GPIO_Pin_0; } EXTI_ClearITPendingBit(EXTI_Line0); //清除中断位 }
屏蔽掉delay_ms程序没问题,基本上就是抄了 ISO板子带的 exti基础程序,延时函数在其他地方(比如12864)调用正常, stm32f10x_it.C 包含头文件如下
#include "stm32f10x_it.h" #include "lcd12864.h" #include "bsp_SysTick.h" extern void TimingDelay_Decrement(void);
然后中断优先级设置了一下: static void NVIC_Configuration(void) { NVIC_InitTypeDef NVIC_InitStructure;
/* Configure one bit for preemption priority */ NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); /* ?????D???¡ä */ NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x02; NVIC_InitStructure.NVIC_IRQChannelSubPriority =0x02; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); }
就是卡在Delay,不知道为什么不跑,,
|