From 8c9162ef8c9c4adfddb772d66ebdeec222757a73 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Thu, 9 Jan 2025 11:26:36 +0100 Subject: [PATCH] esp32[c3|c6|h2]: Fix misconfigured gpio issue --- boards/risc-v/esp32c3/esp32c3-generic/src/esp32c3_gpio.c | 4 ++-- boards/risc-v/esp32c6/esp32c6-devkitc/src/esp32c6_gpio.c | 4 ++-- boards/risc-v/esp32h2/esp32h2-devkit/src/esp32h2_gpio.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/risc-v/esp32c3/esp32c3-generic/src/esp32c3_gpio.c b/boards/risc-v/esp32c3/esp32c3-generic/src/esp32c3_gpio.c index a211c29b78..c751699193 100644 --- a/boards/risc-v/esp32c3/esp32c3-generic/src/esp32c3_gpio.c +++ b/boards/risc-v/esp32c3/esp32c3-generic/src/esp32c3_gpio.c @@ -484,7 +484,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as output */ esp_gpio_matrix_out(g_gpiooutputs[i], SIG_GPIO_OUT_IDX, 0, 0); - esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_1 | INPUT_FUNCTION_1); + esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_2 | INPUT_FUNCTION_2); esp_gpiowrite(g_gpiooutputs[i], 0); pincount++; @@ -503,7 +503,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as interrupt input */ - esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_1 | PULLDOWN); + esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_2 | PULLDOWN); pincount++; } diff --git a/boards/risc-v/esp32c6/esp32c6-devkitc/src/esp32c6_gpio.c b/boards/risc-v/esp32c6/esp32c6-devkitc/src/esp32c6_gpio.c index 8ced3654b4..c88a2217b5 100644 --- a/boards/risc-v/esp32c6/esp32c6-devkitc/src/esp32c6_gpio.c +++ b/boards/risc-v/esp32c6/esp32c6-devkitc/src/esp32c6_gpio.c @@ -484,7 +484,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as output */ esp_gpio_matrix_out(g_gpiooutputs[i], SIG_GPIO_OUT_IDX, 0, 0); - esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_1 | INPUT_FUNCTION_1); + esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_2 | INPUT_FUNCTION_2); esp_gpiowrite(g_gpiooutputs[i], 0); pincount++; @@ -503,7 +503,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as interrupt input */ - esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_1 | PULLDOWN); + esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_2 | PULLDOWN); pincount++; } diff --git a/boards/risc-v/esp32h2/esp32h2-devkit/src/esp32h2_gpio.c b/boards/risc-v/esp32h2/esp32h2-devkit/src/esp32h2_gpio.c index 1ff0e8de96..bd1ae75d01 100644 --- a/boards/risc-v/esp32h2/esp32h2-devkit/src/esp32h2_gpio.c +++ b/boards/risc-v/esp32h2/esp32h2-devkit/src/esp32h2_gpio.c @@ -484,7 +484,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as output */ esp_gpio_matrix_out(g_gpiooutputs[i], SIG_GPIO_OUT_IDX, 0, 0); - esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_1 | INPUT_FUNCTION_1); + esp_configgpio(g_gpiooutputs[i], OUTPUT_FUNCTION_2 | INPUT_FUNCTION_2); esp_gpiowrite(g_gpiooutputs[i], 0); pincount++; @@ -503,7 +503,7 @@ int esp_gpio_init(void) /* Configure the pins that will be used as interrupt input */ - esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_1 | PULLDOWN); + esp_configgpio(g_gpiointinputs[i], INPUT_FUNCTION_2 | PULLDOWN); pincount++; }