diff --git a/arch/xtensa/src/esp32/esp32_gpio.c b/arch/xtensa/src/esp32/esp32_gpio.c index e993308319..3cc4f8690d 100644 --- a/arch/xtensa/src/esp32/esp32_gpio.c +++ b/arch/xtensa/src/esp32/esp32_gpio.c @@ -222,7 +222,7 @@ int esp32_configgpio(int pin, gpio_pinattr_t attr) } else { - func |= (uint32_t)((2 >> FUNCTION_SHIFT) << MCU_SEL_S); + func |= (uint32_t)(PIN_FUNC_GPIO << MCU_SEL_S); } if ((attr & OPEN_DRAIN) != 0)