diff --git a/cpu/stm32/periph/gpio_ll_irq.c b/cpu/stm32/periph/gpio_ll_irq.c index 436cde4651a70..5e9d83d5b15e9 100644 --- a/cpu/stm32/periph/gpio_ll_irq.c +++ b/cpu/stm32/periph/gpio_ll_irq.c @@ -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 @@ -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