mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 10:03:50 +01:00
cpu/stm32/gpio_ll: make style consistent
This block of code inconsistently made use of else-if statments. The patch makes the use consistent. The change also makes the code a bit simpler to read.
This commit is contained in:
parent
1b1fbfeb5c
commit
aef5dfec2b
@ -42,25 +42,19 @@
|
|||||||
|
|
||||||
#if defined(EXTI_SWIER_SWI0) || defined(EXTI_SWIER_SWIER0)
|
#if defined(EXTI_SWIER_SWI0) || defined(EXTI_SWIER_SWIER0)
|
||||||
# define EXTI_REG_SWIER (EXTI->SWIER)
|
# define EXTI_REG_SWIER (EXTI->SWIER)
|
||||||
#endif
|
#elif defined(EXTI_SWIER1_SWI0) || defined(EXTI_SWIER1_SWIER0)
|
||||||
|
|
||||||
#if defined(EXTI_SWIER1_SWI0) || defined(EXTI_SWIER1_SWIER0)
|
|
||||||
# define EXTI_REG_SWIER (EXTI->SWIER1)
|
# define EXTI_REG_SWIER (EXTI->SWIER1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EXTI_RTSR_RT0) || defined(EXTI_RTSR_TR0)
|
#if defined(EXTI_RTSR_RT0) || defined(EXTI_RTSR_TR0)
|
||||||
# define EXTI_REG_RTSR (EXTI->RTSR)
|
# define EXTI_REG_RTSR (EXTI->RTSR)
|
||||||
#endif
|
#elif defined(EXTI_RTSR1_RT0) || defined(EXTI_RTSR1_TR0)
|
||||||
|
|
||||||
#if defined(EXTI_RTSR1_RT0) || defined(EXTI_RTSR1_TR0)
|
|
||||||
# define EXTI_REG_RTSR (EXTI->RTSR1)
|
# define EXTI_REG_RTSR (EXTI->RTSR1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EXTI_FTSR_FT0) || defined(EXTI_FTSR_TR0)
|
#if defined(EXTI_FTSR_FT0) || defined(EXTI_FTSR_TR0)
|
||||||
# define EXTI_REG_FTSR (EXTI->FTSR)
|
# define EXTI_REG_FTSR (EXTI->FTSR)
|
||||||
#endif
|
#elif defined(EXTI_FTSR1_FT0) || defined (EXTI_FTSR1_TR0)
|
||||||
|
|
||||||
#if defined(EXTI_FTSR1_FT0) || defined (EXTI_FTSR1_TR0)
|
|
||||||
# define EXTI_REG_FTSR (EXTI->FTSR1)
|
# define EXTI_REG_FTSR (EXTI->FTSR1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -81,40 +75,30 @@
|
|||||||
# define EXTI_REG_IMR (EXTI->IMR1)
|
# define EXTI_REG_IMR (EXTI->IMR1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RCC_APB2ENR_SYSCFGCOMPEN
|
#if defined(RCC_APB2ENR_SYSCFGCOMPEN)
|
||||||
# define SYSFG_CLOCK APB2
|
# define SYSFG_CLOCK APB2
|
||||||
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGCOMPEN
|
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGCOMPEN
|
||||||
#elif defined(RCC_APB2ENR_SYSCFGEN)
|
#elif defined(RCC_APB2ENR_SYSCFGEN)
|
||||||
# define SYSFG_CLOCK APB2
|
# define SYSFG_CLOCK APB2
|
||||||
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGEN
|
# define SYSFG_ENABLE_MASK RCC_APB2ENR_SYSCFGEN
|
||||||
#endif
|
#elif defined(RCC_APB3ENR_SYSCFGEN)
|
||||||
|
|
||||||
#ifdef RCC_APB3ENR_SYSCFGEN
|
|
||||||
# define SYSFG_CLOCK APB3
|
# define SYSFG_CLOCK APB3
|
||||||
# define SYSFG_ENABLE_MASK RCC_APB3ENR_SYSCFGEN
|
# define SYSFG_ENABLE_MASK RCC_APB3ENR_SYSCFGEN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTI_EXTICR1_EXTI0
|
#if defined(EXTI_EXTICR1_EXTI0)
|
||||||
# define EXTICR_REG(num) (EXTI->EXTICR[(num) >> 2])
|
# define EXTICR_REG(num) (EXTI->EXTICR[(num) >> 2])
|
||||||
#endif
|
#elif defined(SYSCFG_EXTICR1_EXTI0)
|
||||||
|
|
||||||
#ifdef SYSCFG_EXTICR1_EXTI0
|
|
||||||
# define EXTICR_REG(num) (SYSCFG->EXTICR[(num) >> 2])
|
# define EXTICR_REG(num) (SYSCFG->EXTICR[(num) >> 2])
|
||||||
#endif
|
#elif defined(AFIO_EXTICR1_EXTI0)
|
||||||
|
|
||||||
#ifdef AFIO_EXTICR1_EXTI0
|
|
||||||
# define EXTICR_REG(num) (AFIO->EXTICR[(num) >> 2])
|
# define EXTICR_REG(num) (AFIO->EXTICR[(num) >> 2])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SYSCFG_EXTICR1_EXTI1_Pos
|
#if defined(SYSCFG_EXTICR1_EXTI1_Pos)
|
||||||
# define EXTICR_FIELD_SIZE SYSCFG_EXTICR1_EXTI1_Pos
|
# define EXTICR_FIELD_SIZE SYSCFG_EXTICR1_EXTI1_Pos
|
||||||
#endif
|
#elif defined(EXTI_EXTICR1_EXTI1_Pos)
|
||||||
|
|
||||||
#ifdef EXTI_EXTICR1_EXTI1_Pos
|
|
||||||
# define EXTICR_FIELD_SIZE EXTI_EXTICR1_EXTI1_Pos
|
# define EXTICR_FIELD_SIZE EXTI_EXTICR1_EXTI1_Pos
|
||||||
#endif
|
#elif defined(AFIO_EXTICR1_EXTI1_Pos)
|
||||||
|
|
||||||
#ifdef AFIO_EXTICR1_EXTI1_Pos
|
|
||||||
# define EXTICR_FIELD_SIZE AFIO_EXTICR1_EXTI1_Pos
|
# define EXTICR_FIELD_SIZE AFIO_EXTICR1_EXTI1_Pos
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user