From 6f78a7f3310f5da918dd6463e5e3d3511a8400a7 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 3 Aug 2018 16:12:52 +0200 Subject: [PATCH] stm32_common: i2c_2: fix for -Wunused-function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This came up when compiling an application for a STM32-based board with LLVM/clang. The function is not used if I²C is not provided. --- cpu/stm32_common/periph/i2c_2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/stm32_common/periph/i2c_2.c b/cpu/stm32_common/periph/i2c_2.c index 211019211d..f89ea229db 100644 --- a/cpu/stm32_common/periph/i2c_2.c +++ b/cpu/stm32_common/periph/i2c_2.c @@ -507,6 +507,7 @@ static inline int _wait_ready(I2C_TypeDef *i2c) return 0; } +#if I2C_0_ISR || I2C_1_ISR static inline void irq_handler(i2c_t dev) { assert(dev < I2C_NUMOF); @@ -541,6 +542,7 @@ static inline void irq_handler(i2c_t dev) } core_panic(PANIC_GENERAL_ERROR, "I2C FAULT"); } +#endif #if I2C_0_ISR void I2C_0_ISR(void)