Repository navigation
fix(spi): make SK9822 framing datasheet-conformant - #3669
Merged
Merged
Conversation
This was referenced Jul 15, 2026
|
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)
📝 WalkthroughWalkthroughAPA102 and SK9822 encoders now use complete all-ones end frames, including zero-LED auto-brightness cases. Documentation and golden tests were updated for framing boundaries, brightness clamping, payload preservation, and exact output bytes. ChangesSPI frame conformance
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related issues
✨ 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 |
5 tasks
zackees
added a commit
that referenced
this pull request
Jul 16, 2026
…uty fix + lint/test debt cleanup (#3683) * feat(examples): add HydroPack dual EL-panel beat visualizer Dual EL-panel audio-reactive example for ESP32-C3 that is also a valid FastLED WASM sketch. INMP441 audio is normalized (signal conditioning, mic profile, self-normalizing vibe analysis), then bass beats are split by loudness: the inner panel fires on sensitive beats, the outer panel only on loud ones. Panels are gated with low-frequency 50 Hz PWM (LEDC, 12-bit) as required by EL inverter hardware. A ScreenMap disc + ring preview renders the panels in the browser. Refs #3681 Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(channels): move UART waveN encoder to the channel layer The encoder is platform-neutral (inverted UART frame model plus ChipsetTimingConfig only) but lived under platforms/esp/32 and was pulled into the RP build through a forbidden cross-directory _build include. Move the implementation to fl/channels/uart_wave_encoder.*, compile it once via fl/channels/_build.cpp.hpp, keep the ESP-path header as a forwarder, sort rpcommon/_build.cpp.hpp alphabetically, and drop the banned *.cpp.hpp includes from the RP engine host tests (the engines are already compiled into the library on every platform). Clears the CppHppIncludes, PlatformIncludes, PlatformTrampoline, IwyuPragmaBlock, and UnityBuild lint violations that were failing `bash lint --cpp` on every PR. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(lint): clear RP driver and CI lint debt - Add missing platforms/arm/rp/is_rp.h includes to the RP peripheral impls that gate on FL_IS_RP2040/FL_IS_RP2350 - uint32_t -> u32 in RP DMA transfer-count casts - Annotate the deliberate ProgramStorage new/delete pair, the PIO instruction reinterpret_cast, and the static DMA capture buffer with the sanctioned lint suppressions - Replace the tuple[int, int, int] return in test_rp_spi_loopback.py with a frozen slotted SpiPins dataclass (DCT002) - ruff-format autofixes in five ci/ files Together with the encoder move this returns `bash lint` to green. Co-Authored-By: Claude Fable 5 <[email protected]> * test(chipsets): align SK9822/APA102 tests with all-ones end clocks Commit 34a86a7 (#3669) switched the SK9822 encoders to the datasheet-required all-ones end clock frames and gave the zero-LED paths a complete start+end frame, but left the unit tests asserting the old 0x00 end frames. Update the expectations, helper, and test names to the actual contract; fl_chipsets_encoders passes again. Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(examples): drive HydroPack EL panels through the fl pin PWM facade Code-review follow-up: replace the hand-rolled LEDC wrapper (with its Arduino core 2.x/3.x fork) with fl::setPwmFrequency + fl::analogWrite, the same 50 Hz EL-inverter gating path examples/ElPanelReactive uses. Also dedupe the inner/outer beat handler into firePanel(), cache the last written duty (50 Hz PWM only latches once per 20 ms period), pace the frame loop for battery use, fix the millis-wrap first-frame sentinel, and cross-reference ElPanelReactive. Refs #3681 Co-Authored-By: Claude Fable 5 <[email protected]> * refactor(channels): finish UART encoder move, drop ESP forwarding header All includers of the legacy ESP-path header were repo-internal, so update them to fl/channels/uart_wave_encoder.h and delete the forwarder instead of keeping permanent indirection. Move the encoder unit test to tests/fl/channels/ to mirror the source location (and update the placement example in agents/tests.md). Replace the non-ASCII doc glyphs the moved files inherited with ASCII per cpp-standards. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(rp): drop no-op reinterpret_cast in PIO RX program setup pio_instr is a typedef of fl::u16 and mProgramInstructions is already u16[16], so plain pointer decay compiles without any cast; keeping the reinterpret_cast (even suppressed) would silently reinterpret the buffer if pio_instr ever changed width. Co-Authored-By: Claude Fable 5 <[email protected]> * docs(chipsets): correct SPI end-frame formula and SK9822 end-clock docs The encoders write (num_leds / 32) + 1 end DWords, not ceil(num_leds/32) as the doc comments claimed (they differ at 0 and exact multiples of 32), and SK9822 no longer has a different end frame from APA102 since the #3669 all-ones fix. Also replaces the non-ASCII ceiling glyphs. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(esp32): route analogWrite/setPwm16 duty writes to the LEDC channel The ESP32 native pin backend left analogWrite() and setPwm16() as no-op stubs, so the documented setPwmFrequency() + analogWrite() PWM flow configured the LEDC timer and then never updated the duty - the output stayed at 0 (this silently broke the ElPanelReactive example hardware path, and hydropack would have hit the same wall). Duty writes now scale onto the LEDC channel allocated by setPwmFrequencyNative(), with the full-on duty quirk handled. Also clamp the pre-IDF-5.3 duty-resolution fallback to the SoC LEDC timer width (14 bits on C3/S2/S3) instead of a fixed 16, which made low frequencies like 50 Hz fail ledc_timer_config on those parts. Found by the multi-agent code review for #3681. Co-Authored-By: Claude Fable 5 <[email protected]> * fix(tests): restore UTF-8 bytes mangled during the encoder test move The include-swap edits were applied through a PowerShell 5.1 Get-Content/Set-Content round trip, which added a UTF-8 BOM and double-encoded the existing multibyte comment glyphs into mojibake. Restore both files byte-for-byte from master and reapply only the intended include swap. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Phase 7 software framing correction for #3660 / #3648.\n\n- Replaces SK9822's incorrect all-zero end frame with all-one end clocks in normal, HD, and auto-brightness encoders.\n- Makes APA102 and SK9822 auto-brightness zero-LED frames complete (start + end), matching their normal encoders.\n- Adds golden tests for 0/1/31/32/33/257 LEDs, brightness boundaries, BGR byte order, exact size, and every end-clock byte.\n\nValidated locally:\n- �ash test spi_frame_protocol --debug\n- �ash test spi_frame_protocol --cpp\n- �ash test fl_channels_channel --cpp\n- uv run --no-sync python ci/lint_cpp/run_all_checkers.py --no-rust\n\nThe attached-board Phase 7 public-API and loopback evidence remains tracked by #3660 and hardware gate #3631.\n\nCloses #3660
Summary by CodeRabbit
Bug Fixes
Tests