Skip to content

feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF 6.0 CI target (#3515 Phase A) - #3518

Merged
zackees merged 1 commit into
masterfrom
feat/i2s-idf6-target-3515a
Jul 1, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/i2s-idf6-target-3515a

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Two interlocking changes for the classic-ESP32 I2S clockless driver:

  1. Removes FASTLED_ESP32_I2S compile-time selector. The driver code now always compiles on classic ESP32 (via the existing FASTLED_ESP32_HAS_I2S feature flag); --gc-sections elides it when unused. Users select the driver at runtime via FastLED.enableDriver<fl::Bus::FLEX_IO, 0>() — matching the modern channel-manager surface.
  2. Adds an IDF 6.0 CI compile target using pioarduino's prep_IDF6 branch (arduino-esp32 master, ESP-IDF v6.0.1+). This exercises the PERIPH_RCC_ATOMIC() wrap in i2s_periph_compat.h (fix(i2s-esp32dev): wrap IDF 6 LL calls in PERIPH_RCC_ATOMIC critical section #3514) end-to-end for the first time.

Part of #3516 / #3515 Phase A.

Files changed

  • src/FastLED.h — FASTLED_ESP32_I2S becomes a #warning directing users to the runtime-selection API.
  • src/platforms/esp/32/core/fastled_esp32.h — I2S header gated on FASTLED_ESP32_HAS_I2S (feature) instead of the removed selector.
  • src/platforms/esp/clockless.h — dropped the #if defined(FASTLED_ESP32_I2S) branch of the ClocklessController alias.
  • ci/boards.py — new ESP32_IDF_6_PIOARDUINO URL + ESP32DEV_IDF6 board.
  • .github/workflows/build_esp32dev_idf6.yml — compile-smoke workflow.

Migration for users on -DFASTLED_ESP32_I2S=1

Old:

build_flags = -DFASTLED_ESP32_I2S=1
FastLED.addLeds<WS2812, PIN, GRB>(leds, N);  // routed to I2S via -D flag

New (runtime binding):

// legacy addLeds<> unchanged — still routes to RMT (default)
FastLED.enableDriver<fl::Bus::FLEX_IO, 0>();  // opt into I2S at runtime
FastLED.addLeds<WS2812, PIN, GRB>(leds, N);

The #warning in FastLED.h fires at compile time so anyone still passing the old flag gets a clean pointer at the migration path.

Test plan

  • bash test --cpp: 344/344 pass (this is a pure gating change — host code path unaffected).
  • bash lint --cpp: clean.
  • CI build_esp32dev_idf6 — first-ever IDF 6.0 build of FastLED against the pioarduino prep_IDF6 branch. This is the acceptance gate for I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase A.
  • Existing build_esp32_i2s_ws2812 (IDF 5.5) — must stay green with the flag removed.
  • Existing build_esp32dev_idf4.4 — must stay green with the flag removed.

Non-goals

Blockers

If the pioarduino prep_IDF6 branch head moves in a way that breaks the build, we need to pin to the exact commit 98230ad4aa in ci/boards.py. Currently the URL uses the branch symbol which follows HEAD.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added CI support for an ESP32 development target using ESP-IDF 6, expanding build coverage for this platform.
  • Bug Fixes
    • Updated ESP32 driver selection so the app now follows the newer runtime-based approach.
    • Removed reliance on an old compile-time I2S selector and added a clearer warning when it is used.
    • Improved ESP-IDF 6 compatibility for ESP32 clockless/I2S-related builds.

… Phase A)

Per #3516 meta / #3515 Phase A: enable a real IDF 6.0 CI target for
the classic-ESP32 I2S clockless driver, and remove the compile-time
`FASTLED_ESP32_I2S` selector so the driver is bound at runtime via the
modern channel API instead of by preprocessor flag.

## Changes

### Runtime-selected I2S driver
- **`src/FastLED.h`**: `FASTLED_ESP32_I2S` becomes a deprecation warning.
  Compat-shim message directs users to
  `FastLED.enableDriver<fl::Bus::FLEX_IO, 0>()` for runtime selection.
- **`src/platforms/esp/32/core/fastled_esp32.h`**: driver header include
  is now gated on `FASTLED_ESP32_HAS_I2S` (feature flag — auto-enabled
  on classic ESP32) instead of the removed selector. The driver code
  always compiles on classic ESP32; `--gc-sections` elides it when
  unused.
- **`src/platforms/esp/clockless.h`**: removed the `#if defined(FASTLED_ESP32_I2S)`
  branch of the `ClocklessController` alias. Legacy `addLeds<>` continues
  to route to the RMT / PARLIO / SPI default. The I2S path is reached
  through the modern channel API.

### IDF 6.0 CI target
- **`ci/boards.py`**: new `ESP32_IDF_6_PIOARDUINO` platform URL pointing
  at `pioarduino/platform-espressif32#prep_IDF6` (commit `98230ad4aa`,
  2026-05-25). That branch's `platform.json` pins
  `framework-arduinoespressif32` to `arduino-esp32/archive/master.zip`
  — arduino-esp32 master built on ESP-IDF v6.0.1+.
- **`ci/boards.py`**: new `ESP32DEV_IDF6` board using the above,
  `platform_needs_install=True`, no driver-selector defines.
- **`.github/workflows/build_esp32dev_idf6.yml`**: compile-smoke against
  Blink + SpecialDrivers/ESP/DriverTest. Fires on esp/ + i2s/ + ci/
  changes, plus manual PR triggers.

## Why the flag removal matters

- **gc-sections elision**: the driver code compiles unconditionally on
  classic ESP32 (via `FASTLED_ESP32_HAS_I2S`), and gc-sections drops
  it when the user's sketch doesn't reach into the I2S code path. This
  matches the FastLED convention documented in
  `src/fl/channels/README.md` — one binary, multiple drivers, linker
  keeps only what's referenced.
- **User-facing selection**: users get I2S by explicitly asking for it
  at runtime, not by defining a compile-time symbol. This aligns with
  the modern channel-manager surface (`FastLED.enableDriver<>`,
  `Channel::create<>`) that the rest of the driver work in #3516
  builds on.

## Verification

- `bash test --cpp`: 344/344 pass on host (this is a pure gate change —
  no behavioral impact on the host code path).
- `bash lint --cpp`: clean.
- CI compile against IDF 6: exercised by the new `build_esp32dev_idf6.yml`
  workflow once this PR merges to master. The `i2s_periph_compat.h`
  `PERIPH_RCC_ATOMIC()` path (from #3514) will be hit end-to-end for the
  first time.

## What this does NOT do

- Does NOT change legacy `addLeds<WS2812, PIN, GRB>()` behavior on IDF
  4.x/5.x — that path continues to route through RMT / PARLIO / SPI as
  before. Users who previously set `-DFASTLED_ESP32_I2S=1` get a
  deprecation warning and must migrate to
  `FastLED.enableDriver<fl::Bus::FLEX_IO, 0>()` for the same behavior.
- Does NOT touch the classic Yves driver ISR / DMA machinery. That's
  #3512 Phase 2 and follows the Phase B/C/D validation fence.

Part of #3516 / #3515 Phase A.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
@zackees
zackees merged commit 451109d into master Jul 1, 2026
8 of 11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 735cfb36-55b4-48c7-afa9-a403004c1836

📥 Commits

Reviewing files that changed from the base of the PR and between e57f3ff and 5c0bbbe.

📒 Files selected for processing (5)
  • .github/workflows/build_esp32dev_idf6.yml
  • ci/boards.py
  • src/FastLED.h
  • src/platforms/esp/32/core/fastled_esp32.h
  • src/platforms/esp/clockless.h

📝 Walkthrough

Walkthrough

This PR removes the compile-time FASTLED_ESP32_I2S selector in favor of runtime driver selection via FastLED.enableDriver<...>(), updates related documentation/warnings in FastLED.h, fastled_esp32.h, and clockless.h, and adds a new esp32dev_idf6 CI workflow plus a corresponding board/platform definition in ci/boards.py.

Changes

ESP32 I2S Flag Removal and IDF6 CI Support

Layer / File(s) Summary
Deprecation warning for legacy flag
src/FastLED.h
Replaces the ESP-IDF version reliability warning with a deprecation/no-op notice when FASTLED_ESP32_I2S is defined, directing users to FastLED.enableDriver<...>().
Runtime driver selection wiring
src/platforms/esp/32/core/fastled_esp32.h, src/platforms/esp/clockless.h
Switches the I2S clockless driver inclusion to be gated by FASTLED_ESP32_HAS_I2S instead of the removed selector, and removes the compile-time I2S branch in ClocklessController, defaulting the selection chain to PARLIO.
IDF6 CI workflow and board definition
.github/workflows/build_esp32dev_idf6.yml, ci/boards.py
Adds a new esp32dev_idf6 GitHub Actions workflow reusing build_template.yml, plus a new ESP32_IDF_6_PIOARDUINO platform constant and ESP32DEV_IDF6 board entry aliased to esp32dev.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2280: Both switch CI compilation toward the SpecialDrivers/ESP/DriverTest example path.
  • FastLED/FastLED#2515: Both modify ESP32 clockless controller selection to route toward the PARLIO-based controller.
  • FastLED/FastLED#3477: Both change fastled_esp32.h and related clockless selection to remove reliance on FASTLED_ESP32_I2S in favor of runtime driver selection.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/i2s-idf6-target-3515a

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

zackees added a commit that referenced this pull request Jul 1, 2026
…-in (#3519)

Adds a new REQUIRED agent-doc rule capturing the architectural mistake I
made while drafting #3515 Phase B: reaching for `ClocklessI2S<>`
template directly instead of exposing the classic Yves parallel-out
clockless driver through the modern `Bus::FLEX_IO, 0` runtime-selection
surface. User caught it — "the i2s driver is just a flexio type" and
"subtype information about the i2s goes into a device info json
structure." This doc encodes both so future agents don't repeat the
same reach-for-the-template shortcut.

Also compensates for #3518's premature removal of the `FASTLED_ESP32_I2S`
selector: the Yves parallel-out clockless driver is NOT yet reachable via
`Bus::FLEX_IO, 0` on classic ESP32 (that slot currently routes to the
I2S-SPI driver in `drivers/i2s_spi/`), so users on `-DFASTLED_ESP32_I2S=1`
who did `addLeds<WS2812, PIN, GRB>()` would silently fall through to
RMT. Restoring the selector as a temporary opt-in until #3512
Phase 4 wires the Yves clockless through `Bus::FLEX_IO, 0`.

## Changes

**agents/docs/cpp-standards.md**
- New REQUIRED section: "Runtime driver selection is `Bus::FLEX_IO` —
  legacy chipset templates are not."
- Explicit old-way vs new-way code samples.
- Device-info JSON schema example so agents know where subtype info goes.
- Caveat noting that on classic ESP32 today `Bus::FLEX_IO, 0` routes to
  I2S-SPI, NOT the Yves parallel-out clockless — with a pointer to the
  future removal path (#3512 Phase 4).

**src/platforms/esp/clockless.h**
- Restored `#if defined(FASTLED_ESP32_I2S) && !ESP_IDF_VERSION_6_OR_HIGHER`
  branch on the `ClocklessController` alias so users with the flag get
  the Yves driver on their `addLeds<WS2812, PIN, GRB>()` calls.
- Documented in a doc-comment that this is a stopgap pending Phase 4.

**src/FastLED.h**
- Reverted the "removed" claim in the `#warning`. The warning now says
  the flag is on a deprecation path (#3516) and points at the
  migration once Phase 4 lands.

## Verification

- `bash test --cpp`: 344/344 pass.
- `bash lint --cpp`: clean.

Users who set `-DFASTLED_ESP32_I2S=1` before #3518 landed continue to
get the same driver behavior on their `addLeds<>` calls — no regression.

Part of #3516 / #3515 Phase C (agent-doc invariant).

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees added a commit that referenced this pull request Jul 1, 2026
New `src/platforms/esp/32/drivers/i2s/README.md` documenting the
classic-ESP32 I2S parallel-out clockless driver as it stands today
(post #3479 restore + #3511/#3514 IDF6 compat +
#3518-#3520 selector cleanup + Phase 5 unity re-include).

Covers:

- **Files**: purpose of each `.h`/`.cpp.hpp` in the directory
- **User-facing binding today**: legacy `addLeds<>` via
  `-DFASTLED_ESP32_I2S=1` (production) vs modern channel-manager
  (not there yet — depends on Phase 4)
- **ESP-IDF version compat table**: IDF 4.x/5.x production; IDF 6.x
  compiles via the `i2s_periph_compat.h` shim (bench validation
  pending real WROOM + IDF 6 platform binding)
- **Streaming ISR DMA refill invariant**: the whole-point-of-I2S
  streaming pattern that any future refactor must preserve. Points at
  the ISR handler location and lists the three concrete guarantees.
- **Global state**: acknowledges the 10+ file-scope statics tracked
  under #3489, with the migration path via Phase 6.
- **Known bugs**: #1165 (`I2S_DEVICE=1` doesn't drive output)
  and #1384 (blocking `showPixels()`) with their respective
  fix paths through Phase 2 / Phase 4.
- **References**: cross-links to every open sub-issue, meta issue,
  and previous PR in the driver-dev umbrella.

Part of #3516 / #3512 Phase 8.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the feat/i2s-idf6-target-3515a branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant