From 43f83a520b139c6a9f4cf3b95d1d215e28754d62 Mon Sep 17 00:00:00 2001 From: Jue Date: Thu, 1 Apr 2021 19:04:32 +0100 Subject: [PATCH] cpu/stm32/gpio: fix IRQ handler --- cpu/stm32/periph/gpio_all.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpu/stm32/periph/gpio_all.c b/cpu/stm32/periph/gpio_all.c index e505cd2e4d..560909e5f3 100644 --- a/cpu/stm32/periph/gpio_all.c +++ b/cpu/stm32/periph/gpio_all.c @@ -348,11 +348,14 @@ void isr_exti(void) uint32_t pending_isr = pending_rising_isr | pending_falling_isr; #else - /* only generate interrupts against lines which have their IMR set */ - uint32_t pending_isr = (EXTI_REG_PR & EXTI_REG_IMR & EXTI_MASK); + /* read all pending interrupts wired to isr_exti */ + uint32_t pending_isr = (EXTI_REG_PR & EXTI_MASK); /* clear by writing a 1 */ EXTI_REG_PR = pending_isr; + + /* only generate soft interrupts against lines which have their IMR set */ + pending_isr &= EXTI_REG_IMR; #endif /* iterate over all set bits */