Repository navigation
feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF 6.0 CI target (#3515 Phase A) - #3518
Conversation
… 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]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR removes the compile-time ChangesESP32 I2S Flag Removal and IDF6 CI Support
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…-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]>
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]>
Summary
Two interlocking changes for the classic-ESP32 I2S clockless driver:
FASTLED_ESP32_I2Scompile-time selector. The driver code now always compiles on classic ESP32 (via the existingFASTLED_ESP32_HAS_I2Sfeature flag);--gc-sectionselides it when unused. Users select the driver at runtime viaFastLED.enableDriver<fl::Bus::FLEX_IO, 0>()— matching the modern channel-manager surface.prep_IDF6branch (arduino-esp32master, ESP-IDF v6.0.1+). This exercises thePERIPH_RCC_ATOMIC()wrap ini2s_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_I2Sbecomes a#warningdirecting users to the runtime-selection API.src/platforms/esp/32/core/fastled_esp32.h— I2S header gated onFASTLED_ESP32_HAS_I2S(feature) instead of the removed selector.src/platforms/esp/clockless.h— dropped the#if defined(FASTLED_ESP32_I2S)branch of theClocklessControlleralias.ci/boards.py— newESP32_IDF_6_PIOARDUINOURL +ESP32DEV_IDF6board..github/workflows/build_esp32dev_idf6.yml— compile-smoke workflow.Migration for users on
-DFASTLED_ESP32_I2S=1Old:
New (runtime binding):
The
#warninginFastLED.hfires 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.build_esp32dev_idf6— first-ever IDF 6.0 build of FastLED against the pioarduinoprep_IDF6branch. 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.build_esp32_i2s_ws2812(IDF 5.5) — must stay green with the flag removed.build_esp32dev_idf4.4— must stay green with the flag removed.Non-goals
--i2shandler — that's I2S classic-ESP32 bring-up on IDF 4/5/6 via AutoResearch loopback + ISR DMA refill #3515 Phase B, next PR.Blockers
If the pioarduino
prep_IDF6branch head moves in a way that breaks the build, we need to pin to the exact commit98230ad4aainci/boards.py. Currently the URL uses the branch symbol which follows HEAD.🤖 Generated with Claude Code
Summary by CodeRabbit