纯粹的新手,学习F0。基本照抄的官方EXTI例程,我想在中断处理函数中加上让LED3和LED4亮一会再灭掉,可是执行到亮了以后延时600毫秒时,LED怎么也不灭了。这个Delay_ms用到了SysTick,自己写一个空循环的延时程序就可以正常执行。主程序中调用Delay_ms也正常,这会是什么原因造成的?请高手指教。
void EXTI0_1_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line0) != RESET)
{
/* Turn on LED3 and LED4 during 1s each time User button is pressed */
GPIO_WriteBit(LED3_GPIO_PORT, LED3_PIN | LED4_PIN, Bit_SET);
/* wait for 600ms */
Delay_ms(600);
/* Turn off LED3 and LED4 after 1s each time User button is pressed */
GPIO_WriteBit(LED4_GPIO_PORT, LED3_PIN | LED4_PIN, Bit_RESET);
/* BlinkMode: 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6, then re-cycle */
BlinkMode++;
if(BlinkMode == 7)
{
BlinkMode = 0;
}
/* Clear the EXTI line 0 pending bit */
EXTI_ClearITPendingBit(EXTI_Line0);
}
} |