Repository navigation
docs+fix: Bus::FLEX_IO runtime-selection guardrail + restore Yves opt-in - #3519
Conversation
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]>
|
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 (3)
📝 WalkthroughWalkthroughChanges update ESP32 FASTLED_ESP32_I2S handling: the deprecation warning in FastLED.h now fires only for ESP-IDF 5+ and references runtime driver selection; clockless.h adds a ClocklessI2S controller branch for pre-IDF6 builds; and cpp-standards.md documents required Bus::FLEX_IO runtime driver selection for parallel-IO test harnesses. ChangesESP32 I2S Driver Deprecation and Runtime Selection
Estimated code review effort: 2 (Simple) | ~12 minutes 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 |
…ch work (REQUIRED) (#3536) * feat(i2s): engine mode-dispatch scaffolding for SPI batches (#3526 Phase 2c prep) Adds per-channel mode dispatch in `ChannelEngineI2sEsp32Dev::show()` so mixed clockless+SPI batches and pure-SPI batches are refused cleanly with `DriverState::ERROR` instead of silently sending garbage through the clockless wave8 encoder. Sets up the Phase 2c architecture: the peripheral is the dispatch boundary (per the parallel-IO unified-engine rule in `agents/docs/cpp-standards.md`), and I2S1 can only run one mode at a time. The engine now recognizes each channel's mode and routes accordingly. ## Behavior matrix | Batch composition | Result | |---------------------------|-------------------------------------------| | All clockless (existing) | Wave8 encoding → peripheral transmit ✅ | | All SPI | ERROR state (Phase 2c-SPI stub) | | Mixed clockless + SPI | ERROR state (mixed batches never allowed) | The SPI-path stub is deliberate: the actual SPI transmit machinery (FIFO width reconfigure, DMA slot, clock rate) is bench-blocked because it needs WROOM validation. Once the Phase 2c-SPI PR lands with real transmit code, only the two ERROR-returning early-outs change to full `showSpi()` calls. Clockless behavior is preserved bit-identical — all 4 existing engine tests still pass unchanged. ## Test additions 3 new `FL_TEST_CASE`s in `channel_engine_i2s_esp32dev.cpp`: - Pure clockless batch still succeeds (regression protection) - Pure SPI batch rejected with ERROR + no peripheral transmit - Mixed batch rejected with ERROR + no peripheral transmit + both channels released from in-use marking New test helper `makeSpiChannelData(dataPin, clockPin, byte_count, fill_byte)` produces a channel with `SpiChipsetConfig` so the mode dispatch has real SPI channels to reject. ## What this does NOT do - Does NOT implement `showSpi()` — that's the real Phase 2c PR (bench-blocked). - Does NOT change the current clockless code path — pure clockless batches take the exact same wave8 encoding + peripheral transmit they did before. ## Verification - `bash test --cpp`: 345/345 pass (3 new subcases inside existing test file) - `bash lint --cpp`: clean Part of #3516 meta / #3526 Phase 2c prep. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * docs(agents): check if target device is attached before deferring bench work (REQUIRED) New REQUIRED rule in `agents/docs/cpp-standards.md`: Before declaring any driver / peripheral / autoresearch task as "bench-blocked" or "requires physical hardware I don't have," agents must FIRST attempt on-device validation via `bash autoresearch <board>`. The AutoResearch harness is a first-class in-loop step — if the device is attached and reachable, autoresearch will compile via fbuild, flash, boot, and RPC-ping in one command. ## Origin Established 2026-07-01 during #3516 I2S driver rewrite. Agent had deferred Phases 2b–2e as "bench-blocked" across multiple rounds while the developer's ESP32-WROOM was in fact attached to COM11 and running. Developer prompted "the esp32wroom is attached" — one line unblocked a whole cluster of previously-deferred phases. Verified working during this session: - `bash autoresearch esp32dev` compiled + flashed + booted the AutoResearch example on COM11. - `RESULT: {"chip":"ESP32 (Xtensa)","type":"ready",...}` boot line in ~10s. - `Ping successful` RPC confirmed. - `flexIoDeviceInfo` RPC (from #3525) returned real peripheral binding data — confirmed classic ESP32 today routes `Bus::FLEX_IO, 0` to `I2S_SPI`, matching the agent-doc caveat. ## Rule shape Follows the same "check first, defer second" pattern as the Bus::FLEX_IO rule from #3519. Concrete commands for each supported platform, explicit failure signal to look for, guidance on what to write when hardware is genuinely absent (specific failure mode so next agent doesn't repeat the check). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Two interlocking changes prompted by user feedback during #3515 Phase B drafting:
New REQUIRED agent-doc rule captured in
agents/docs/cpp-standards.md: any AutoResearch harness / test-driver code exercising a parallel-IO peripheral MUST reach for theBus::FLEX_IOruntime-selection surface, not the legacy chipset class template. Subtype information (which peripheral is bound, port/instance, mode) belongs in a device-info JSON structure returned by the runtime engine — not baked into the harness.Fix: restore the
FASTLED_ESP32_I2Scompile-time opt-in that feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF 6.0 CI target (#3515 Phase A) #3518 removed. The removal was premature because the Yves parallel-out clockless driver is NOT yet reachable viaBus::FLEX_IO, 0on classic ESP32 (that slot currently routes to the I2S-SPI driver indrivers/i2s_spi/). Users on-DFASTLED_ESP32_I2S=1withaddLeds<WS2812, PIN, GRB>()would silently fall through to RMT after feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF 6.0 CI target (#3515 Phase A) #3518. This restores the working opt-in with a doc-comment marking it as stopgap pending I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 4.Files
agents/docs/cpp-standards.md— new REQUIRED section: "Runtime driver selection isBus::FLEX_IO— legacy chipset templates are not." Includes:Bus::FLEX_IO, 0binding on classic ESP32src/platforms/esp/clockless.h— put back the#if defined(FASTLED_ESP32_I2S)branch that feat(i2s): remove FASTLED_ESP32_I2S selector, add IDF 6.0 CI target (#3515 Phase A) #3518 removed. Includes an in-code comment pointing at the removal path (I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 4).src/FastLED.h— reverted the "flag was removed" claim in the#warning. Now says the flag is on a deprecation path (Meta: classic-ESP32 I2S parallel-out clockless driver dev — bring-up + unify + validate on IDF 4/5/6 #3516) with the migration note pointing at I2S classic-ESP32 unified path: Phases 2, 4-8 (follow-up to #3509) #3512 Phase 4.What this documents for future agents
The bad path I fell into:
The right path once #3512 Phase 4 lands:
And subtype info via device-info JSON:
{ "bus": "FLEX_IO", "instance": 0, "peripheral": "I2S1_PARALLEL", "port": 1, "silicon": "ESP32-D0WD-V3", "mode": "clockless" }Test plan
bash test --cpp: 344/344 pass.bash lint --cpp: clean.-DFASTLED_ESP32_I2S=1continue to get the Yves driver onaddLeds<>calls.Part of
#3516 meta / #3515 Phase C (documentation ratchet portion). The host-test portion of Phase C is deferred to a follow-up once #3512 Phase 4 exposes the peripheral surface that can be exercised without reaching for the classic template.
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Bug Fixes