Repository navigation
refactor(rx/decode_ws2812): apply CodeRabbit follow-ups from #3036 (ASCII + header/impl split) - #3037
Conversation
…pp definition Addresses two CodeRabbit findings on #3036: 1. **ASCII-only header.** The previous header used Unicode glyphs (->, --, <=) in comments. Per the path-specific source-encoding rule for `src/fl/channels/rx/decode_ws2812.h`, that header must be 7-bit ASCII. Replaced all Unicode characters with ASCII equivalents. 2. **No function definitions in plain .h files.** The previous implementation defined `decodeWs2812Edges()` inline in the .h. Per the project convention used throughout fl/channels/rx (see channel.h <-> channel.cpp.hpp), function definitions go in a .cpp.hpp companion compiled exactly once into the FastLED unity build, while the .h carries only the declaration. Created `src/fl/channels/rx/decode_ws2812.cpp.hpp` and added the include to `src/fl/channels/rx/_build.cpp.hpp`. Behaviour unchanged: this is purely a file-layout split. The two CodeRabbit findings that flagged latent semantic bugs in the gap-tolerance ordering and the error-rate denominator are preserved from the original Native + LPC decoders and explicitly documented in the header's "Preserved-from-original quirks" block; fixing them is out of scope for the consolidation PR and tracked under #3035 follow-ups. Verification: * tests/fl_channels_rx_sct_capture (5 cases) -- pass * tests/fl_channels_rx (15 cases) -- pass * bash lint --cpp -- clean Refs #3035. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesWS2812 Decoder Extraction to Translation Unit
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
… sketch retirement) (#3043) Phase 3 of FastLED #3035 (decoder consolidation across the four EdgeTime-based RX backends + AutoResearchLpc.ino retirement) is now shipped end-to-end: * #3037 split the shared 4-phase WS2812 decoder into `src/fl/channels/rx/decode_ws2812.{h,cpp.hpp}` so the LPC SCT-RX and native paths share one implementation. * #3041 folded `examples/AutoResearchLpc/AutoResearchLpc.ino` into the main `examples/AutoResearch/AutoResearch.ino` low-memory mode (auto-engaged on FL_PLATFORM_HAS_LARGE_MEMORY == 0). * The `ci/autoresearch/phases.py` orchestrator dispatch updated to point at the unified sketch as part of #3041. What remains in #3035 are Phases 1, 2a, 2b -- the hardware bench validation work that needs real LPC845-BRK silicon + scope. That hardware sign-off is shared with the #2880 checklist now in `src/platforms/arm/lpc/README.md`. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Follow-up to #3036 (squash-merged as
b99cc8e3c). #3036 was merged before I had a chance to push the CodeRabbit responses, so the two coding-standard violations CR flagged are sitting in master now. This PR addresses them.CR findings addressed
src/fl/channels/rx/decode_ws2812.h. The header used Unicode glyphs (->,--,<=, etc.) in comments. Replaced with ASCII equivalents..hfiles undersrc/fl/channels/rx/. MoveddecodeWs2812Edges()from the header to a newsrc/fl/channels/rx/decode_ws2812.cpp.hppcompanion (matches the existingchannel.h/channel.cpp.hpppair in the same directory) and wired it intosrc/fl/channels/rx/_build.cpp.hppso it compiles exactly once intolibfastled.CR findings explicitly deferred (see PR #3036 inline replies)
CodeRabbit also flagged two latent semantic bugs in the consolidated decoder — reset-pulse detection firing before gap-tolerance evaluation, and the error-rate denominator missing partial-bit residue. Both behaviours are preserved verbatim from the original Native + LPC decoders that #3036 consolidated. Faithful consolidation has to match prior behaviour byte-for-byte; correcting these would silently change shipped behaviour for two backends under a refactor-named PR. They are now explicitly documented in the new header's "Preserved-from-original quirks" block and queued for a follow-up under #3035 Phase 3.
Test plan
tests/fl_channels_rx_sct_capture— 5/5 pass on the rebuilt host stubtests/fl_channels_rx— 15/15 passdecodeWs2812Edges()via the FastLED unity-build link)🤖 Generated with Claude Code
Summary by CodeRabbit