summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/extint.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/extint.c')
-rw-r--r--stmhal/extint.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/stmhal/extint.c b/stmhal/extint.c
index c0471719b8..02b06fde5e 100644
--- a/stmhal/extint.c
+++ b/stmhal/extint.c
@@ -251,10 +251,13 @@ void extint_swint(uint line) {
if (line >= EXTI_NUM_VECTORS) {
return;
}
+ // we need 0 to 1 transition to trigger the interrupt
#if defined(MCU_SERIES_L4)
- EXTI->SWIER1 = (1 << line);
+ EXTI->SWIER1 &= ~(1 << line);
+ EXTI->SWIER1 |= (1 << line);
#else
- EXTI->SWIER = (1 << line);
+ EXTI->SWIER &= ~(1 << line);
+ EXTI->SWIER |= (1 << line);
#endif
}