stm32如何在中断服务程序里关闭EXTI中断

2024-12-01 04:18:19
推荐回答(2个)
回答1:

那个中断已经被触发了,你要做的只有是清中断标志位:
EXTI_ClearITPendingBit(EXTI_Line14);
EXTI_ClearFlag(EXTI_Line14);
非要关的话,我觉得这样就关了
EXTI_InitStructure.EXTI_Line = EXTI_Line14;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = DISABLE; //ENABLE
EXTI_Init(&EXTI_InitStructure);

回答2:

EXTI_InitStructure.EXTI_LineCmd = DISABLE,应当可以吧.
希望对你能有所帮助。