Repository navigation
feat(i2s): wave3 sibling encoder for I2S1 modern driver (#3526 Phase 2a) - #3554
Conversation
…e COM port Previously the unified WDT was armed lazily by FL_WATCHDOG_AUTO() at the top of loop(). If setup() hung (RPC bind null-deref, stalled static-init, wedged serial handshake), no WDT was armed and the COM port stayed owned by a dead sketch until manual power-cycle. Arm the WDT with a 20 s window at the very top of setup() so a hang here auto-reboots. Feed the WDT in the serial-monitor wait loop because on classic ESP32 (non-USB-CDC) that loop can span up to AUTORESEARCH_SERIAL_WAIT_MS = 120 s, well past the setup WDT window. FL_WATCHDOG_AUTO() at loop() top re-arms with the shorter loop-scoped timeout once setup() has finished. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Adds `encodeChannelWave3_i2s1` alongside the existing `encodeChannelWave8_i2s1` to satisfy the meta-issue acceptance criterion "Wave3 fallback path exercised for a three-slot chipset". Wave3 saves 2.67x memory vs wave8 for chipsets whose T1/T2/T3 timing rounds to 1/2/N ticks per 3, gated by `fl::canUseWave3(timing)`. Pixel clock is per-chipset via `fl::wave3ClockFrequencyHz(timing)` instead of the fixed 8 MHz wave8 rate. The encoder reuses the shared `fl::wave3Transpose_16` kernel from `fl/channels/wave3.h` — same anti-drift rule as the wave8 sibling. Host tests verify byte-exact output against a direct-kernel-call reference using canonical WS2812 timing (verified wave3-eligible). Drops the `fl/channels/detail/wave3.hpp` and `detail/wave8.hpp` force-inline includes from this .cpp.hpp — the unity build pulls this file across multiple TUs and the force-inline kernels would emit in each. The public `.h` declarations resolve at link time to the single out-of-line definitions in `wave3.cpp.hpp` / `wave8.cpp.hpp`, avoiding double-inline bloat. 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 (4)
📝 WalkthroughWalkthroughThis PR makes two unrelated changes: it updates AutoResearch.ino to arm the unified watchdog earlier in setup() with a longer timeout and feeds the watchdog during the serial-ready wait; and it adds a new Wave3 sibling encoder (encodeChannelWave3_i2s1) to the ESP32 I2S1 driver, with sizing constants, declarations, implementation, and tests. ChangesAutoResearch Watchdog Setup
Wave3 I2S1 Encoder Addition
Estimated code review effort: 2 (Simple) | ~12 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 |
Summary
Adds
encodeChannelWave3_i2s1alongsideencodeChannelWave8_i2s1— satisfies the #3526 acceptance criterion "Wave3 fallback path exercised for a three-slot chipset".Wave3 saves 2.67x memory vs wave8 for chipsets whose T1/T2/T3 rounds to 1/2/N ticks per 3-tick period (e.g., WS2812 canonical timing). Gated by
fl::canUseWave3(timing); per-chipset clock viafl::wave3ClockFrequencyHz(timing)instead of wave8's fixed 8 MHz.Anti-drift + no-inline-bloat
Encoder reuses the shared
fl::wave3Transpose_16kernel fromfl/channels/wave3.h(same anti-drift rule as the wave8 sibling — if the shared kernel changes, we inherit it). Host tests verify byte-exact output against a direct-kernel-call reference using canonical WS2812 timing.Drops
fl/channels/detail/wave3.hpp/detail/wave8.hppforce-inline includes from this .cpp.hpp — the unity build pulls this file across multiple TUs and the force-inline kernels would emit in each. Public.hdeclarations resolve at link time to the single out-of-line definitions inwave3.cpp.hpp/wave8.cpp.hpp.Test plan
bash test wave8_encoder_i2s1— passesbash test --cpp— 344/344 tests passbash lint --cpp— clean🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests