How to disable/MASK an exti line ON THE FLY
I'm currently trying to implement a button interrupt and need to disable the button interrupt after the initial call to the isr to avoid excessive interrupt triggering due to debounce. I'm using STM32CUBEIDE/MX currently. The button works as desired if I use
HAL_NVIC_DisableIRQ(EXTI9_5_IRQn); (in interrupt)
//do some stuff
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn); (in main)
but this is non-ideal as it disables exti lines 5 through 9.
I've been trying to mask the EXTI line using EXTI_IMR. This seems to work for the first button press, but I'm never able to re-trigger the ISR
EXTI->IMR &= ~(EXTI_LINE_5);//in ISR
EXTI->IMR &= (EXTI_LINE_5);//in main
Thoughts?
