How to disable/MASK an exti line?
Try to implement an atomtic operation to avoid a specific interrupt generated by GPIOB GPIO_PIN_8 . If using the code as below, it works.
HAL_NVIC_DisableIRQ(EXTI9_5_IRQn);
//atomtic operation
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
But tried the code as following, it doesn't work. Using GPIOB GPIO_PIN_8 as external interrupt.
// #define EXTI_LINE_8 (EXTI_GPIO | 0x08u) /*!< External interrupt line 8 */
//The value of EXTI_LINE_8 is 0x6000008
EXTI->IMR &= ~(EXTI_LINE_8);
//atomtic operation
EXTI->IMR |= (EXTI_LINE_8);
//And tried GPIO_PIN_8, it's still not working.
#define GPIO_PIN_8 ((uint16_t)0x0100) /* Pin 8 selected */
EXTI->IMR &= ~(GPIO_PIN_8);
//atomtic operation
EXTI->IMR |= (GPIO_PIN_8);
Any suggetsions?