From fd30434921fd7137d3f926b5712aceb305bd79da Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 19 Nov 2024 11:55:22 +0100 Subject: [PATCH] tests/periph/selftest_shield: fix GPIO IRQ testing The GPIO IRQ tests had a side-effect that IRQs remained configured after the test case was complete. This caused stray IRQs to trigger on SAM0 MCUs and they consequently (and incorrectly) failed the test. --- tests/periph/selftest_shield/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/periph/selftest_shield/main.c b/tests/periph/selftest_shield/main.c index 44ce2fbab7..ad4316c95f 100644 --- a/tests/periph/selftest_shield/main.c +++ b/tests/periph/selftest_shield/main.c @@ -554,6 +554,9 @@ static bool periph_gpio_irq_test_falling(void) brief_delay(); failed |= TEST(atomic_load(&cnt) == 3); + /* disable IRQ again to not have side effects */ + gpio_irq_disable(ARDUINO_PIN_3); + print_result(failed); return failed; } @@ -617,6 +620,9 @@ static bool periph_gpio_irq_test_rising(void) brief_delay(); failed |= TEST(atomic_load(&cnt) == 3); + /* disable IRQ again to not have side effects */ + gpio_irq_disable(ARDUINO_PIN_3); + print_result(failed); return failed; }