void LOCK_EXIT_IRQHANDLER(void) //这是中断函数吗
{
if(EXTI_GetITStatus(LOCK_EXIT_LINE) != RESET){
if(LOCK_STA != lockStatus){
delay_ms(10); //延迟10ms
if(LOCK_STA != lockStatus){
if(!isUnLock){
lockStatus = LOCK_STA;
isUnLock = 1;
}
}
}
}
delay_ms(100); //延迟100ms
EXTI_ClearITPendingBit(LOCK_EXIT_LINE);
}
如果上面的是中断函数,里面加这么久的延迟是不科学的,所以会出现异常现象 |