From 360ab12956685b45ea0720f44d193224db12afed Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sun, 30 Jan 2022 08:36:34 +0100 Subject: [PATCH 09/12] hal: conditional definition of gpio_mode_t Define type `gpio_mode_t` only if it is not yet defined by RIOT `periph/gpio`. When this header is used during the compilation of RIOT source, this type definition isn't required and leads to name conflicts with RIOT's `gpio_mode_t` definition. The definition of `gpio_mode_t` in this header is only required when ESP-IDF source code is compiled. In that case RIOT's `gpio_mode_t` isn't defined. --- components/hal/include/hal/gpio_types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/hal/include/hal/gpio_types.h b/components/hal/include/hal/gpio_types.h index a9b56f7c6a..8a15b8e396 100644 --- a/components/hal/include/hal/gpio_types.h +++ b/components/hal/include/hal/gpio_types.h @@ -369,6 +369,7 @@ typedef enum { #define GPIO_MODE_DEF_OD (BIT2) ///< bit mask for OD mode /** @endcond */ +#ifndef HAVE_GPIO_MODE_T typedef enum { GPIO_MODE_DISABLE = GPIO_MODE_DEF_DISABLE, /*!< GPIO mode : disable input and output */ GPIO_MODE_INPUT = GPIO_MODE_DEF_INPUT, /*!< GPIO mode : input only */ @@ -377,6 +378,7 @@ typedef enum { GPIO_MODE_INPUT_OUTPUT_OD = ((GPIO_MODE_DEF_INPUT) | (GPIO_MODE_DEF_OUTPUT) | (GPIO_MODE_DEF_OD)), /*!< GPIO mode : output and input with open-drain mode*/ GPIO_MODE_INPUT_OUTPUT = ((GPIO_MODE_DEF_INPUT) | (GPIO_MODE_DEF_OUTPUT)), /*!< GPIO mode : output and input mode */ } gpio_mode_t; +#endif typedef enum { GPIO_PULLUP_DISABLE = 0x0, /*!< Disable GPIO pull-up resistor */ -- 2.17.1