From c94780add642469b0077975a0fbcea084755d7e5 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 22 Jan 2024 15:28:03 +0100 Subject: [PATCH] fixup! cpu/sam0_common: implement periph_gpio_ll_irq --- cpu/sam0_common/periph/gpio_ll_irq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpu/sam0_common/periph/gpio_ll_irq.c b/cpu/sam0_common/periph/gpio_ll_irq.c index e1b426034702..98304c5a8cce 100644 --- a/cpu/sam0_common/periph/gpio_ll_irq.c +++ b/cpu/sam0_common/periph/gpio_ll_irq.c @@ -181,8 +181,11 @@ void gpio_ll_irq_unmask_and_clear(gpio_port_t port, uint8_t pin) int exti_num = get_exti_num(port_num, pin); assume(exti_num >= 0); - EIC_SEC->INTENSET.reg = 1U << exti_num; - EIC_SEC->INTFLAG.reg = 1U << exti_num; + unsigned irq_state = irq_disable(); + uint32_t mask = 1U << exti_num; + EIC_SEC->INTFLAG.reg = mask; + EIC_SEC->INTENSET.reg = mask; + irq_restore(irq_state); } int gpio_ll_irq(gpio_port_t port, uint8_t pin, gpio_irq_trig_t trig,