From 259c4854df5ab01ba9431c140ce1b62b86201b5e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 23 Feb 2025 00:49:12 +0100 Subject: [PATCH] Fix LED for ESP32S3 Signed-off-by: Pol Henarejos --- src/led/led_neopixel.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/led/led_neopixel.c b/src/led/led_neopixel.c index fbb71e8..b97228c 100644 --- a/src/led/led_neopixel.c +++ b/src/led/led_neopixel.c @@ -35,14 +35,18 @@ tNeopixel pixel[] = { { 0, NP_RGB(255, 255, 255) }, /* white */ }; -void led_driver_init() { -#ifdef GPIO_NUM_48 - // ESP32-S3 uses GPIO48 - uint8_t gpio = GPIO_NUM_48; +#if defined(CONFIG_IDF_TARGET_ESP32S3) + #define NEOPIXEL_PIN GPIO_NUM_48 +#elif defined(CONFIG_IDF_TARGET_ESP32S2) + #define NEOPIXEL_PIN GPIO_NUM_15 +#elif defined(CONFIG_IDF_TARGET_ESP32C6) + #define NEOPIXEL_PIN GPIO_NUM_8 #else - // Other ESP32 (ESP32-S2) may use another GPIO. GPIO15 is used by Mini S2 - uint8_t gpio = GPIO_NUM_15; + #define NEOPIXEL_PIN GPIO_NUM_27 #endif + +void led_driver_init() { + uint8_t gpio = NEOPIXEL_PIN; if (phy_data.led_gpio_present) { gpio = phy_data.led_gpio; }