diff --git a/cpu/stm32f1/periph/i2c.c b/cpu/stm32f1/periph/i2c.c index e738c7fcb7..6c87b92953 100644 --- a/cpu/stm32f1/periph/i2c.c +++ b/cpu/stm32f1/periph/i2c.c @@ -33,7 +33,7 @@ #include "debug.h" /* guard file in case no I2C device is defined */ -#if I2C_NUMOF +#if I2C_0_EN /* static function definitions */ static void _start(I2C_TypeDef *dev, uint8_t address, uint8_t rw_flag); @@ -392,4 +392,4 @@ static inline void _stop(I2C_TypeDef *dev) dev->CR1 |= I2C_CR1_STOP; } -#endif /* I2C_NUMOF */ +#endif /* I2C_0_EN */ diff --git a/cpu/stm32f1/periph/spi.c b/cpu/stm32f1/periph/spi.c index 0c92e32787..1486acadc7 100644 --- a/cpu/stm32f1/periph/spi.c +++ b/cpu/stm32f1/periph/spi.c @@ -29,7 +29,7 @@ #include "debug.h" /* guard file in case no SPI device is defined */ -#if SPI_NUMOF +#if SPI_0_EN int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed) { @@ -231,4 +231,4 @@ void spi_poweroff(spi_t dev) } } -#endif /* SPI_NUMOF */ +#endif /* SPI_0_EN */ diff --git a/cpu/stm32f1/periph/timer.c b/cpu/stm32f1/periph/timer.c index eedd4c6c17..73157a95e0 100644 --- a/cpu/stm32f1/periph/timer.c +++ b/cpu/stm32f1/periph/timer.c @@ -31,6 +31,8 @@ #define ENABLE_DEBUG (0) #include "debug.h" +/* guard file in case no TIMER device is defined */ +#if TIMER_0_EN || TIMER_1_EN static inline void irq_handler(tim_t timer, TIM_TypeDef *dev0, TIM_TypeDef *dev1); @@ -119,8 +121,8 @@ int timer_set(tim_t dev, int channel, unsigned int timeout) int timer_set_absolute(tim_t dev, int channel, unsigned int value) { - TIM_TypeDef *timer0 = NULL; - TIM_TypeDef *timer1 = NULL; + TIM_TypeDef *timer0; + TIM_TypeDef *timer1; switch (dev) { #if TIMER_0_EN @@ -406,3 +408,4 @@ static inline void irq_handler(tim_t timer, TIM_TypeDef *dev0, TIM_TypeDef *dev1 thread_yield(); } } +#endif /* TIMER_0_EN || TIMER_1_EN */ diff --git a/cpu/stm32f1/periph/uart.c b/cpu/stm32f1/periph/uart.c index 27574f6c95..a63ab8d65f 100644 --- a/cpu/stm32f1/periph/uart.c +++ b/cpu/stm32f1/periph/uart.c @@ -29,6 +29,9 @@ #include "sched.h" #include "thread.h" +/* guard file in case no UART device is defined */ +#if UART_0_EN || UART_1_EN + /** * @brief Each UART device has to store two callbacks. */