Skip to content

Commit

Permalink
Merge #19446
Browse files Browse the repository at this point in the history
19446: cpu/stm32: Fix periph_gpio_ll_irq r=MrKevinWeiss a=maribu

### Contribution description

This fixes a high impact typo that broke GPIO LL IRQ support on a bunch of STM32 families.

This also adds a compile time check that prevents using `SYSFG` without having `SYSFG_CLOCK` defined to prevent future issues like this.

### Testing procedure

```
make BOARD=nucleo-f429zi flash test-with-config -j16 -C tests/periph_gpio_ll
[...]
TEST SUCCEEDED
```



Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
  • Loading branch information
bors[bot] and maribu authored Apr 4, 2023
2 parents d6dc3a1 + 1c13d3c commit 2e1cd43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cpu/stm32/periph/gpio_ll_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@
#ifdef RCC_APB2ENR_SYSCFGCOMPEN
# define SYSFG_CLOCK APB2
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGCOMPEN
#endif

#ifdef RCC_APBENR2_SYSCFGEN
# define SYSFG_ENABLE_MASK RCC_APBENR2_SYSCFGEN
#elif defined(RCC_APB2ENR_SYSCFGEN)
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGEN
# ifdef APB12
# define SYSFG_CLOCK APB12
# else
Expand All @@ -106,6 +104,9 @@

#ifdef SYSCFG_EXTICR1_EXTI0
# define EXTICR_REG(num) (SYSCFG->EXTICR[(num) >> 2])
# ifndef SYSFG_CLOCK
# error "SYSFG_CLOCK not defined, but EXTICR reg is in SYSFG"
# endif
#endif

#ifdef AFIO_EXTICR1_EXTI0
Expand Down

0 comments on commit 2e1cd43

Please sign in to comment.