From ec44fd167a74a42bfab767c1c42a952b00bb9727 Mon Sep 17 00:00:00 2001 From: Karan Vijayakumar Date: Thu, 27 Nov 2025 03:10:39 +0900 Subject: [PATCH] Add ESP32-C6 pin validation for strapping and USB-JTAG pins --- wled00/pin_manager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wled00/pin_manager.cpp b/wled00/pin_manager.cpp index 709263e1a..729e84503 100644 --- a/wled00/pin_manager.cpp +++ b/wled00/pin_manager.cpp @@ -232,6 +232,13 @@ bool PinManager::isPinOk(byte gpio, bool output) if (gpio > 21 && gpio < 33) return false; // 22 to 32: not connected + SPI FLASH // JTAG: GPIO39-42 are usually used for inline debugging // GPIO46 is input only and pulled down + #elif defined(CONFIG_IDF_TARGET_ESP32C6) + // strapping pins: 8, 9, 15 + // GPIO 0-23 directly usable, 24-30 are for SPI flash + if (gpio > 23 && gpio < 31) return false; // 24-30 SPI FLASH + #if ARDUINO_USB_CDC_ON_BOOT == 1 || ARDUINO_USB_DFU_ON_BOOT == 1 + if (gpio == 12 || gpio == 13) return false; // 12-13 USB-JTAG + #endif #else if ((strncmp_P(PSTR("ESP32-U4WDH"), ESP.getChipModel(), 11) == 0) || // this is the correct identifier, but....