Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
9649125
Disable other envs to save CI build time
netmindz Nov 8, 2025
0f10558
ESP32-C6 buildenv
softhack007 Jun 13, 2024
cf195af
build only esp32c6dev_4MB
netmindz Nov 8, 2025
db65e30
use esp32_idf_V5.platform
netmindz Nov 8, 2025
fa5aa58
Update platformio.ini
softhack007 Jun 13, 2024
152bfd1
Merge branch 'V5' into V5-C6
softhack007 Dec 1, 2025
1bc63ca
use the same lib_deps as the "main V5" branch
softhack007 Dec 1, 2025
6961059
minor changes for consistency with other build envs
softhack007 Dec 1, 2025
45d105e
Merge branch 'V5' into V5-C6
softhack007 Dec 1, 2025
b2d6591
disable QuickEspNow - seems incompatible with -C6
softhack007 Dec 1, 2025
62ca377
remove special FASTLED_NO_FASTLED hack
softhack007 Dec 1, 2025
7023545
treat C6 similar to C3
softhack007 Dec 1, 2025
1de36ca
more "C6 is like C3" adjustments
softhack007 Dec 1, 2025
2df4c58
disable touch button code on C6
softhack007 Dec 1, 2025
3f441f0
guess what ... more "C6 is like C3" ifdefs needed
softhack007 Dec 1, 2025
c73935d
small fix
softhack007 Dec 1, 2025
c096c5b
fix for old-style WLED_RELEASE_NAME
softhack007 Dec 1, 2025
5ecf76c
Merge branch 'V5' into V5-C6
softhack007 Dec 1, 2025
bc4b6b6
Merge branch 'V5' into V5-C6
softhack007 Dec 1, 2025
7b54be8
Merge branch 'V5' into V5-C6
softhack007 Dec 1, 2025
9f12301
esp32c6 inherits build_unflags and lib_ignore from V5 buildenv
softhack007 Dec 1, 2025
f88fd07
temporary workaround for #5145
softhack007 Dec 1, 2025
d3e92f2
Fix ESP32-C6 runtime crash and improve compatibility
karan-vk Nov 26, 2025
ec44fd1
Add ESP32-C6 pin validation for strapping and USB-JTAG pins
karan-vk Nov 26, 2025
c92abb8
Address PR comments: cleanup and safety improvements
karan-vk Nov 29, 2025
e4d6848
Revert .vscode/extensions.json
karan-vk Nov 29, 2025
d2c1313
Fully revert .vscode/extensions.json to base branch
karan-vk Nov 29, 2025
4ebbd86
Use Aircoookie/ESPAsyncWebServer v2.4.2 instead of softhack007 fork
karan-vk Nov 29, 2025
2f267a8
Merge pull request #5114 from karan-vk/esp32c6-fixes
softhack007 Jan 10, 2026
cf09c0d
Comment out '#pragma warning' suppression flag
softhack007 Feb 7, 2026
01b1c51
Add experimental ESP32-C5 support with WiFi 6 dual-band
jonny190 Feb 7, 2026
8268c4a
Applied changes based on comments on PR
jonny190 Feb 7, 2026
11f5be1
Removed Leftover file
jonny190 Feb 7, 2026
35706f0
Apply suggestion from @coderabbitai[bot] for WiFi band
netmindz Feb 7, 2026
5137768
Address PR review: pin pioarduino, fix I2S1 remap, simplify arch check
jonny190 Feb 7, 2026
d2e6a56
Use NeoPixelBus fork with ESP32-C5 bit-bang and I2S fixes
jonny190 Feb 7, 2026
1a025f5
Fix MAC address on ESP32-C5 and update NeoPixelBus fork
jonny190 Feb 8, 2026
f0acc62
Merge pull request #5355 from jonny190/ESP32-C5-V5
softhack007 Feb 8, 2026
83c37f8
Merge branch 'V5' into V5-C6
softhack007 Feb 8, 2026
6cefd14
fix C5 build error
softhack007 Feb 8, 2026
16262ee
platformio.ini: moving [esp32c5] upwards
softhack007 Feb 8, 2026
b2e0c24
simplify and correct some long ifdef chains
softhack007 Feb 8, 2026
a1a1905
simplify C5 buildenv
softhack007 Feb 8, 2026
a3a3547
adding [env:esp32c5dev_8MB_qspi]
softhack007 Feb 8, 2026
b860a1a
fix incorrect PSRAM warning on C5 and C6
softhack007 Feb 8, 2026
20dd750
alexa build error was already solved in V5 branch
softhack007 Feb 8, 2026
e9b1a53
PSRAM guard bugfix
softhack007 Feb 8, 2026
8b98a7a
future support: adding C61 and P4 to esp32RMTInvertIdle() guard
softhack007 Feb 8, 2026
0920f0f
extend some chip type guards for C6 and P4
softhack007 Feb 8, 2026
b30951e
C6 buildenv cleanup
softhack007 Feb 8, 2026
6b9f90c
remove outdated patched libs for C6
softhack007 Feb 8, 2026
3c24681
ifdef guards alignment
softhack007 Feb 8, 2026
9232bd4
correct straping pin comments in pinManager
softhack007 Feb 8, 2026
be49f34
add include guard for esp_mac.h
softhack007 Feb 8, 2026
1800a32
align index.js with chip types from nodestruct.h
softhack007 Feb 8, 2026
9d63296
fix debug delay condition in wled.cpp
softhack007 Feb 8, 2026
d7ab1f4
Merge branch 'V5' into V5-C6
softhack007 Feb 8, 2026
7370c10
remove dead (and dangerous) mutex macros in bus_manager.cpp (#5364)
softhack007 Feb 9, 2026
8159768
ToDO: research how to set PWM duty cycle and hpoint for dithering
softhack007 Feb 9, 2026
d8616e6
C5/C6 minor updates
softhack007 Feb 9, 2026
5b46b9c
experimental: enable 5Ghz WiFi on C5
softhack007 Feb 9, 2026
576e82b
report errors from 5Ghz wifi config
softhack007 Feb 9, 2026
e104529
move 5Ghz init after WiFi.mode(WIFI_STA)
softhack007 Feb 9, 2026
6e70d0c
clarification
softhack007 Feb 9, 2026
b72568f
ESP32-C5 does not support analog dithering (yet)
softhack007 Feb 10, 2026
d3251c5
Use Wifi class method to activate 5Ghz Wifi
softhack007 Feb 10, 2026
f02e6b6
proper wifi channel & band reporting
softhack007 Feb 10, 2026
b128585
fix compiler warning "comparing signed with unsigned is undefined beh…
softhack007 Feb 10, 2026
ab65e9f
C5: change NeoPixelBus reference to "wled-c5-stable" tag
softhack007 Feb 10, 2026
ed6b82b
repeat WiFi.setBandMode() in initConnection()
softhack007 Feb 10, 2026
7014d4f
nitpick: fixing another case of "comparing unsigned to integer is und…
softhack007 Feb 10, 2026
edf0cbe
adding wled_boards.h to reduce #if defined() .. clutter
softhack007 Feb 10, 2026
d823ab4
replace some very long if defined() chains with flags from wled_boards.h
softhack007 Feb 10, 2026
cd911ae
oopsie
softhack007 Feb 10, 2026
4f9c48f
consistency fix
softhack007 Feb 10, 2026
71cf78b
Merge branch 'V5' into V5-C6
softhack007 Feb 10, 2026
546384b
fixing minor errors
softhack007 Feb 10, 2026
1009855
shorten some more ifdef chains in wled.h
softhack007 Feb 10, 2026
c6739d3
ToDo: adjust Wi-Fi stregth to match value allowed by V5 framework
softhack007 Feb 10, 2026
08ca41b
expand chip-specific "if defined" to C61 and P4 (future support)
softhack007 Feb 10, 2026
a39285a
Add WiFi band preference for dual-band ESP32 chips (#5367)
jonny190 Feb 10, 2026
703b90f
Merge branch 'V5' into V5-C6
softhack007 Feb 10, 2026
f8df68c
tiny change
softhack007 Feb 10, 2026
b730ce8
removing another mega guard
softhack007 Feb 10, 2026
e046316
add channel to wifi scan result list (wifi settings)
softhack007 Feb 10, 2026
f8a6790
5Ghz wifi scanning
softhack007 Feb 10, 2026
55eee94
support higher Tx power (V5 only)
softhack007 Feb 10, 2026
46a1b2f
clarification
softhack007 Feb 10, 2026
ede8a14
ifdef fixes
softhack007 Feb 10, 2026
deaae11
missed one
softhack007 Feb 11, 2026
5e073ce
add esp-idf managed folders to .gitignore
softhack007 Feb 11, 2026
c1dddea
ermove duplicate extern references
softhack007 Feb 11, 2026
7ce497b
fix broken ifdef chain in wled.h
softhack007 Feb 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
compile_commands.json
__pycache__/

/.dummy
/dependencies.lock
/managed_components

esp01-update.sh
platformio_override.ini
replace_fs.py
Expand Down
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"pioarduino.pioarduino-ide",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
Expand Down
11 changes: 6 additions & 5 deletions pio-scripts/set_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,16 @@ def add_wled_metadata_flags(env, node):
if not has_def(cdefs, "WLED_REPO"):
repo = get_github_repo()
if repo:
print(f"repo = {repo}")
cdefs.append(("WLED_REPO", f"\\\"{repo}\\\""))

cdefs.append(("WLED_VERSION", WLED_VERSION))

# This transforms the node in to a Builder; it cannot be modified again
return env.Object(
node,
CPPDEFINES=cdefs
)
# Return the node unmodified - middleware should not create new build targets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToDO: this is a temporary hack - the root cause is solved in the latest pioarduino (and tasmota, too?). Remember to revert this change once we upgrade to latest platform packages.

print(f"version = {WLED_VERSION}")
# Instead, modify the environment's CPPDEFINES before the file is compiled
env["CPPDEFINES"] = cdefs
return node

env.AddBuildMiddleware(
add_wled_metadata_flags,
Expand Down
157 changes: 157 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ default_envs =
esp32_wrover
lolin_s2_mini ;; TODO: disabled NeoEsp32RmtMethodIsr
esp32c3dev
esp32c6dev_4MB
esp32c5dev
; esp32s3dev_16MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3dev_8MB_opi ;; TODO: disabled NeoEsp32RmtMethodIsr
; esp32s3_4M_qspi ;; TODO: disabled NeoEsp32RmtMethodIsr
Expand Down Expand Up @@ -169,6 +171,7 @@ upload_speed = 115200
lib_compat_mode = strict
lib_deps =
fastled/FastLED @ 3.10.1
;; https://github.com/softhack007/FastLED.git#ESP32-C6 ;; patched version for -C6
; IRremoteESP8266 @ 2.8.2 ;; TODO: add back
;; neopixelbus dependancy moved into [8266] and [esp32_all_variants] sections
https://github.com/Aircoookie/ESPAsyncWebServer.git#v2.4.2
Expand Down Expand Up @@ -385,6 +388,160 @@ lib_ignore = ${esp32_idf_V5.lib_ignore}
board_build.partitions = ${esp32.default_partitions} ;; default partioning for 4MB Flash - can be overridden in build envs
board_build.flash_mode = qio


[esp32c5]
;; generic definitions for all ESP32-C5 boards
;; NOTE: ESP32-C5 requires pioarduino platform (Tasmota framework doesn't include C5 Arduino libs yet)
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.36/platform-espressif32.zip
platform_packages =
build_unflags = ${esp32_idf_V5.build_unflags}
-D WLED_ENABLE_DMX_INPUT ;; esp_dmx library doesn't support C5 UART registers yet
build_flags = -g
-Wshadow=compatible-local
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C5
-DCONFIG_IDF_TARGET_ESP32C5=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DCO
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_MODE
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V5.build_flags}
lib_deps =
;; NB: we spell out deps explicitly (instead of ${esp32_idf_V5.lib_deps}) to replace
;; the upstream NeoPixelBus with a C5-patched fork; using both causes duplicate compilation.
;; TODO: remove the temporarily Override below once NeoPixelBus has official support for -C5
;; ${esp32_all_variants.lib_deps}
esp32async/AsyncTCP @ 3.4.6
bitbank2/AnimatedGIF@^1.4.7
https://github.com/Aircoookie/GifDecoder.git#bc3af189b6b1e06946569f6b4287f0b79a860f8e
https://github.com/jonny190/NeoPixelBus.git#wled-c5-stable ;; wled-c5-stable for C5 support: I2S exclusion, bit-bang CSR/GPIO, channel ctor overload
https://github.com/netmindz/esp_dmx/#esp-idf-v5-fixes
${env.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}
esp_dmx ;; esp_dmx library doesn't support C5 UART registers yet
extra_scripts = ${scripts_defaults.extra_scripts}

[esp32c6]
;; generic definitions for all ESP32-C6 boards
platform = ${esp32_idf_V5.platform}
platform_packages = ${esp32_idf_V5.platform_packages}
;;platform_packages =
;; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1
;; framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.1/esp32-arduino-libs-3.0.1.zip

;; board = esp32-c6-devkitm-1 ;; board must be defined in the lower-level [env:*] buildenvs for C6-based boards
build_unflags = ${esp32_idf_V5.build_unflags}
build_flags = -g
-DARDUINO_ARCH_ESP32
-DARDUINO_ARCH_ESP32C6
-DCONFIG_IDF_TARGET_ESP32C6=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DCO
-DARDUINO_USB_MODE=1 ;; this flag is - most likely - mandatory for ESP32-C6
;; please make sure that the following flags are properly set (to 0 or 1) by your board.json, or included in your custom platformio_override.ini entry:
;; ARDUINO_USB_CDC_ON_BOOT
${esp32_idf_V5.build_flags}
lib_deps =
${esp32_idf_V5.lib_deps}
lib_ignore = ${esp32_idf_V5.lib_ignore}


[env:esp32c6dev_8MB]
;; ESP32-C6 "devkit C" with 8MB flash
extends = esp32c6
platform = ${esp32c6.platform}
platform_packages = ${esp32c6.platform_packages}
framework = arduino
board = esp32-c6-devkitc-1

build_unflags = ${esp32c6.build_unflags}
;;-D CORE_DEBUG_LEVEL=0
;;-D NDEBUG
build_flags = ${common.build_flags} ${esp32c6.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C6_8MB\"
-Wno-volatile -Wno-deprecated-declarations ;; silence compiler warnings
;; -Wno-cpp ;; silence '#pragma warning' messages
;;-D DEBUG -g3 -ggdb
;;-D CORE_DEBUG_LEVEL=4
-D WLED_WATCHDOG_TIMEOUT=0
;; -DLOLIN_WIFI_FIX ; might be needed on "-C6 mini"
;;-DARDUINO_USB_CDC_ON_BOOT=1 ;; for virtual CDC USB
-DARDUINO_USB_CDC_ON_BOOT=0 ;; for serial-to-USB chip
-D WLED_DISABLE_INFRARED ;; library not not compatible with -C6
-D WLED_DISABLE_ESPNOW ;; ToDO: temporarily disabled, until we find a solution for esp-now build errors with -C6
upload_speed = 460800
lib_deps = ${esp32c6.lib_deps}
lib_ignore = ${esp32c6.lib_ignore}
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
QuickEspNow ; ToDO: disabled until we find a compatible version

board_build.partitions = ${esp32.large_partitions}
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.memory_type = qio_qspi
monitor_filters = esp32_exception_decoder

[env:esp32c6dev_4MB]
;; ESP32-C6 "devkit M" with 4MB flash
extends = env:esp32c6dev_8MB
board = esp32-c6-devkitm-1
board_build.partitions = ${esp32.default_partitions}
build_unflags = ${env:esp32c6dev_8MB.build_unflags} -D WLED_RELEASE_NAME=\"ESP32-C6_8MB\"
build_flags = ${env:esp32c6dev_8MB.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C6_4MB\"


[env:esp32c5dev]
;; ESP32-C5 "devkit C" with 4MB flash, no PSRAM - EXPERIMENTAL
extends = esp32c5
board = esp32-c5-devkitc-1
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.memory_type = qio_qspi ;; flash config only, this board has no PSRAM

build_flags = ${common.build_flags} ${esp32c5.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C5\"
-Wno-volatile -Wno-deprecated-declarations
-D WLED_WATCHDOG_TIMEOUT=0
-DARDUINO_USB_MODE=1 ;; this flag is mandatory for ESP32-C5
-DARDUINO_USB_CDC_ON_BOOT=0 ;; for serial-to-USB chip
-D WLED_DISABLE_INFRARED ;; library not compatible with -C5
-D WLED_DISABLE_ESPNOW ;; not yet tested
-D WLED_DEBUG
lib_ignore = ${esp32c5.lib_ignore}
IRremoteESP8266
QuickEspNow

board_build.partitions = ${esp32.big_partitions}
upload_speed = 460800
monitor_filters = esp32_exception_decoder

[env:esp32c5dev_8MB_qspi]
;; ESP32-C5 with 8MB flash and PSRAM - EXPERIMENTAL
extends = esp32c5
board = esp32-c5-devkitc1-n8r4
board_build.f_flash = 80000000L
board_build.flash_mode = qio
board_build.arduino.memory_type = qio_qspi ;; this board has PSRAM

build_flags = ${common.build_flags} ${esp32c5.build_flags} -D WLED_RELEASE_NAME=\"ESP32-C5_8MB_qspi\"
-Wno-volatile -Wno-deprecated-declarations
-D BOARD_HAS_PSRAM
-D WLED_WATCHDOG_TIMEOUT=0
-DARDUINO_USB_MODE=1 ;; this flag is mandatory for ESP32-C5
-DARDUINO_USB_CDC_ON_BOOT=0 ;; for serial-to-USB chip
-D WLED_DISABLE_INFRARED ;; library not compatible with -C5
-D WLED_DISABLE_ESPNOW ;; not yet tested
-D WLED_DEBUG
lib_ignore = ${esp32c5.lib_ignore}
IRremoteESP8266
QuickEspNow

board_build.partitions = ${esp32.large_partitions}
board_upload.flash_size = 8MB
board_upload.maximum_size = 8388608
upload_speed = 460800
monitor_filters = esp32_exception_decoder


[esp32s3]
;; generic definitions for all ESP32-S3 boards
platform = ${esp32_idf_V5.platform}
Expand Down
30 changes: 15 additions & 15 deletions usermods/audioreactive/audio_reactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ class AudioReactive : public Usermod {
static const char _dynamics[];
static const char _frequency[];
static const char _inputLvl[];
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(CONFIG_IDF_TARGET_ESP32) // analog mic is only supported on classic esp32
static const char _analogmic[];
#endif
static const char _digitalmic[];
Expand Down Expand Up @@ -1160,23 +1160,23 @@ class AudioReactive : public Usermod {

// Reset I2S peripheral for good measure
i2s_driver_uninstall(I2S_NUM_0); // E (696) I2S: i2s_driver_uninstall(2006): I2S port 0 has not installed
#if !defined(CONFIG_IDF_TARGET_ESP32C3)
#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5)
delay(100);
periph_module_reset(PERIPH_I2S0_MODULE); // not possible on -C3
#endif
Comment on lines +1163 to 1166
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

echo "=== Checking platformio.ini for ESP32-C6 environments ==="
grep -n -i 'c6\|esp32c6' platformio.ini | head -20

echo ""
echo "=== Checking if audioreactive is excluded for any boards ==="
grep -n -A2 -B2 'audioreactive' platformio.ini | head -30

echo ""
echo "=== Searching for existing CONFIG_IDF_TARGET_ESP32C6 in codebase ==="
find . -name "*.cpp" -o -name "*.h" | xargs grep -l "CONFIG_IDF_TARGET_ESP32C6" | head -10

echo ""
echo "=== Checking audio_reactive.cpp for any C6 mentions ==="
grep -n "C6\|c6" usermods/audioreactive/audio_reactive.cpp

echo ""
echo "=== Check if there are any guards using C6 anywhere ==="
rg "CONFIG_IDF_TARGET_ESP32C6" -t cpp -t h --max-count 20

Repository: wled/WLED

Length of output: 10066


🏁 Script executed:

#!/bin/bash

echo "=== Checking what changed in this PR (if git available) ==="
git log --oneline -1 2>/dev/null || echo "Git info not available"

echo ""
echo "=== Look at the specific lines mentioned in review (1163-1166) ==="
sed -n '1160,1170p' usermods/audioreactive/audio_reactive.cpp

echo ""
echo "=== Check broader pattern - all lines with CONFIG_IDF_TARGET_ESP32C3 in audio_reactive.cpp ==="
grep -n "CONFIG_IDF_TARGET_ESP32C3" usermods/audioreactive/audio_reactive.cpp

Repository: wled/WLED

Length of output: 3096


🏁 Script executed:

#!/bin/bash

echo "=== Check if ESP32-C6 is used in any other usermods ==="
find usermods -name "*.cpp" -o -name "*.h" | xargs grep -l "CONFIG_IDF_TARGET_ESP32C6" 2>/dev/null

echo ""
echo "=== Check main WLED code for C6 support patterns ==="
find wled00 -name "*.cpp" -o -name "*.h" | xargs grep -l "CONFIG_IDF_TARGET_ESP32C6" 2>/dev/null | head -10

echo ""
echo "=== Check if there are peripheral reset guards for C6 elsewhere ==="
rg "PERIPH_I2S0_MODULE" -A2 -B2 --max-count 10

Repository: wled/WLED

Length of output: 944


Add ESP32-C6 to all guards that exclude C3 and C5 in this file.

The audioreactive usermod is inconsistent with itself: audio_source.h includes C6 guards, but audio_reactive.cpp does not. C6 is a RISC-V chip like C3/C5 and lacks the same peripherals (PERIPH_I2S0_MODULE reset, analog ADC over I2S, PDM support). Since C6 build support exists in platformio.ini and is properly guarded elsewhere in WLED, the missing C6 checks here will cause failures if someone enables audioreactive for C6.

Add !defined(CONFIG_IDF_TARGET_ESP32C6) to all exclusion guards and defined(CONFIG_IDF_TARGET_ESP32C6) to all inclusion guards throughout this file, matching the pattern used for C3 and C5.

🤖 Prompt for AI Agents
In `@usermods/audioreactive/audio_reactive.cpp` around lines 1163 - 1166, The
guards around peripheral/feature-specific code (e.g., the block calling
delay(100) and periph_module_reset(PERIPH_I2S0_MODULE)) must also exclude
ESP32-C6 like C3/C5; update all conditional compilation checks in this file to
add !defined(CONFIG_IDF_TARGET_ESP32C6) where you currently have
!defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5), and
add defined(CONFIG_IDF_TARGET_ESP32C6) to any inclusion guards that mirror C3/C5
patterns so the file matches audio_source.h's handling of C6.

delay(100); // Give that poor microphone some time to setup.

useBandPassFilter = false;

#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5)
if ((i2sckPin == I2S_PIN_NO_CHANGE) && (i2ssdPin >= 0) && (i2swsPin >= 0) && ((dmType == 1) || (dmType == 4)) ) dmType = 5; // dummy user support: SCK == -1 --means--> PDM microphone
#endif

switch (dmType) {
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32S3)
// stub cases for not-yet-supported I2S modes on other ESP32 chips
case 0: //ADC analog
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5)
case 5: //PDM Microphone
#endif
#endif
Expand Down Expand Up @@ -1204,7 +1204,7 @@ class AudioReactive : public Usermod {
delay(100);
if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
break;
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5)
case 5:
DEBUGSR_PRINT(F("AR: I2S PDM Microphone - ")); DEBUGSR_PRINTLN(F(I2S_PDM_MIC_CHANNEL_TEXT));
audioSource = new I2SSource(SAMPLE_RATE, BLOCK_SIZE, 1.0f/4.0f);
Expand All @@ -1220,7 +1220,7 @@ class AudioReactive : public Usermod {
if (audioSource) audioSource->initialize(i2swsPin, i2ssdPin, i2sckPin, mclkPin);
break;

#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
// ADC over I2S is only possible on "classic" ESP32
case 0:
DEBUGSR_PRINTLN(F("AR: Analog Microphone (left channel only)."));
Expand Down Expand Up @@ -1797,7 +1797,7 @@ class AudioReactive : public Usermod {
top[FPSTR(_addPalettes)] = addPalettes;

#ifdef ARDUINO_ARCH_ESP32
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
JsonObject amic = top.createNestedObject(FPSTR(_analogmic));
amic["pin"] = audioPin;
#endif
Expand Down Expand Up @@ -1856,16 +1856,16 @@ class AudioReactive : public Usermod {
configComplete &= getJsonValue(top[FPSTR(_addPalettes)], addPalettes);

#ifdef ARDUINO_ARCH_ESP32
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
configComplete &= getJsonValue(top[FPSTR(_analogmic)]["pin"], audioPin);
#else
audioPin = -1; // MCU does not support analog mic
#endif

configComplete &= getJsonValue(top[FPSTR(_digitalmic)]["type"], dmType);
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32S3)
if (dmType == 0) dmType = SR_DMTYPE; // MCU does not support analog
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5)
if (dmType == 5) dmType = SR_DMTYPE; // MCU does not support PDM
#endif
#endif
Expand Down Expand Up @@ -1903,14 +1903,14 @@ class AudioReactive : public Usermod {
#ifdef ARDUINO_ARCH_ESP32
uiScript.print(F("uxp=ux+':digitalmic:pin[]';")); // uxp = shortcut for AudioReactive:digitalmic:pin[]
uiScript.print(F("dd=addDropdown(ux,'digitalmic:type');"));
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
uiScript.print(F("addOption(dd,'Generic Analog',0);"));
#endif
uiScript.print(F("addOption(dd,'Generic I2S',1);"));
uiScript.print(F("addOption(dd,'ES7243',2);"));
uiScript.print(F("addOption(dd,'SPH0654',3);"));
uiScript.print(F("addOption(dd,'Generic I2S with Mclk',4);"));
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5)
uiScript.print(F("addOption(dd,'Generic I2S PDM',5);"));
#endif
uiScript.print(F("addOption(dd,'ES8388',6);"));
Expand Down Expand Up @@ -1946,7 +1946,7 @@ class AudioReactive : public Usermod {
uiScript.print(F("addInfo(uxp,0,'<i>sd/data/dout</i>','I2S SD');"));
uiScript.print(F("addInfo(uxp,1,'<i>ws/clk/lrck</i>','I2S WS');"));
uiScript.print(F("addInfo(uxp,2,'<i>sck/bclk</i>','I2S SCK');"));
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
uiScript.print(F("addInfo(uxp,3,'<i>only use -1, 0, 1 or 3</i>','I2S MCLK');"));
#else
uiScript.print(F("addInfo(uxp,3,'<i>master clock</i>','I2S MCLK');"));
Expand Down Expand Up @@ -2069,7 +2069,7 @@ const char AudioReactive::_config[] PROGMEM = "config";
const char AudioReactive::_dynamics[] PROGMEM = "dynamics";
const char AudioReactive::_frequency[] PROGMEM = "frequency";
const char AudioReactive::_inputLvl[] PROGMEM = "inputLevel";
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C5) && !defined(CONFIG_IDF_TARGET_ESP32S3)
const char AudioReactive::_analogmic[] PROGMEM = "analogmic";
#endif
const char AudioReactive::_digitalmic[] PROGMEM = "digitalmic";
Expand Down
2 changes: 1 addition & 1 deletion usermods/audioreactive/audio_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// see https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/chip-series-comparison.html#related-documents
// and https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-reference/peripherals/i2s.html#overview-of-all-modes
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2) || defined(ESP8266) || defined(ESP8265)
#if defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C5) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C61) || defined(CONFIG_IDF_TARGET_ESP32H2) || defined(ESP8266) || defined(ESP8265)
// there are two things in these MCUs that could lead to problems with audio processing:
// * no floating point hardware (FPU) support - FFT uses float calculations. If done in software, a strong slow-down can be expected (between 8x and 20x)
// * single core, so FFT task might slow down other things like LED updates
Expand Down
10 changes: 6 additions & 4 deletions wled00/FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ extern byte realtimeMode; // used in getMappedPixelIndex()
#define WLED_FPS 42
#define FRAMETIME_FIXED (1000/WLED_FPS)
#define FRAMETIME strip.getFrameTime()
#if defined(ARDUINO_ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S2)
#define MIN_FRAME_DELAY 2 // minimum wait between repaints, to keep other functions like WiFi alive
#elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3)
#define MIN_FRAME_DELAY 3 // S2/C3 are slower than normal esp32, and only have one core
#if defined(ARDUINO_ARCH_ESP32)
#if (SOC_CPU_CORES_NUM < 2)
#define MIN_FRAME_DELAY 3 // S2/C3/C6/C5 are slower than normal esp32, and only have one core
#else
#define MIN_FRAME_DELAY 2 // classic esp32/S3/P4: minimum wait between repaints, to keep other functions like WiFi alive
#endif
#else
#define MIN_FRAME_DELAY 8 // 8266 legacy MIN_SHOW_DELAY
#endif
Expand Down
Loading