Repository navigation
docs(agents): check if target device is attached before deferring bench work (REQUIRED) - #3536
Conversation
…ase 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]>
…ch 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]>
|
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)
📝 WalkthroughWalkthroughThis PR adds Phase 2c per-batch mode dispatch to the ESP32dev I2S channel engine's show() method, rejecting SPI-only and mixed clockless+SPI batches with an error state while allowing clockless-only batches to proceed, plus corresponding tests and a documentation update on bench-check procedures. ChangesPhase 2c Dispatch and Bench-Check Documentation
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 |
New REQUIRED rule in agents/docs/cpp-standards.md. Established during #3516 I2S driver rewrite. Agent had deferred Phase 2b-2e as bench-blocked while developer's WROOM was in fact attached on COM11. Rule captured so future agents check first via bash autoresearch , defer second.
Summary by CodeRabbit
New Features
Bug Fixes
Tests