From e92669fc501fb8b7512fd6890a6eb379b6ae90c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20T=C3=B6nz?= Date: Thu, 29 Sep 2022 14:43:11 +0200 Subject: [PATCH] defines: prevent redefinition of UNUSED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prevent compiler warnings/errors we have to wrap the definition of UNUSED with an ifndef. So there are no problems if this is already defined in the project Signed-off-by: Peter Tönz --- Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h index f9bbec2de..d0a683531 100644 --- a/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h +++ b/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h @@ -54,7 +54,9 @@ typedef enum /* Exported macro ------------------------------------------------------------*/ -#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ +#ifndef UNUSED + #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ +#endif #define HAL_MAX_DELAY 0xFFFFFFFFU