Repository navigation
Conversation
Adds the Phase-2 surface area for FastLED #3021 — the ws2812SctTest JSON-RPC handler in the LPC845-BRK sketch, an --ws2812-loopback autoresearch subcommand, and the Python orchestrator that exercises the 5 fixed WS2812 patterns matching the FlexIO flexioObjectFledTest. What ships ---------- * `examples/AutoResearchLpc/AutoResearchLpc.ino` — new ws2812SctTest handler gated behind `#if defined(FASTLED_LPC_RX_SCT_WS2812)`. Default OFF; the include + handler only compile in when the user passes `-DFASTLED_LPC_RX_SCT_WS2812=1`. Patterns: 0 — Red single LED 1 — RGB three-LED chain 2 — All zeros (T0H/T0L fidelity) 3 — All ones (T1H/T1L fidelity) 4 — 100-LED alternating R/G/B Drives TX via `FastLED.show()` through the existing bit-bang `clockless_arm_lpc.h` driver (sync TX as the issue specifies), captures via the Phase-1 polling-mode `LpcSctRxChannel`, decodes 4-phase WS2812 timing, byte-matches against expected. Returns CSV `success,test_case,num_leds,exp_bytes,dec_bytes,matched,mismatched,edges`. * `ci/autoresearch/test_lpc_ws2812_loopback.py` — Python orchestrator mirroring `test_flexio_rx_objectfled.py` but adapted to the LPC sketch's positional-args + CSV-string RPC contract. * `ci/autoresearch/args.py` — new `--ws2812-loopback` CLI flag. * `ci/autoresearch/phases.py` — `_run_lpc_ws2812_loopback_tests` dispatcher routing lpc845brk + --ws2812-loopback to the orchestrator. Two documented blockers for hardware acceptance ----------------------------------------------- Both are PRE-EXISTING (independent of #3021 itself) and tracked separately so the Phase-2 plumbing can land first and the hardware gate closes when both blockers are resolved: 1. **Polling-mode SCT capture is too slow for 800 kHz WS2812.** Phase 1's `LpcSctRxChannel::pollOnce()` measures one capture per ~2 µs on M0+ @ 30 MHz; WS2812 sub-pulses are 400–850 ns. `mismatched > 0` is **expected** on real silicon for this orchestrator until the SCT→DMA upgrade lands as a follow-up to this PR. The orchestrator's final summary prints a reminder. 2. **fl::json soft-FP flash bloat (FastLED #3002) blocks `<FastLED.h>` from fitting in the LPC845 64 KB budget alongside `fl::Remote`.** The `FASTLED_LPC_RX_SCT_WS2812` flag is therefore default OFF — the bring-up sketch keeps fitting today's budget, and once #3002 lands the flag flips on for the lpc845brk fbuild target. What this PR does NOT do ------------------------ - Does NOT upgrade the SCT capture path to DMA. That's a follow-up. - Does NOT optimize the AutoResearchLpc flash footprint. That's #3002. - Does NOT validate against real LPC845 silicon — no hardware attached in this dev environment. Code is bench-ready but un-validated. Why ship it now --------------- Mirrors the Phase 1 PR's split-architecture approach: land the contract and orchestrator first so the hardware gate is a code-free acceptance step (just flash + run + observe). The polling-vs-DMA gap + flash-budget unlock can then be addressed independently without re-litigating the RPC surface or test plan. Test plan --------- - [x] `bash lint` clean on all touched files (C++ + Python). - [x] Python syntax check via `ast.parse` for all modified .py files. - [ ] **Hardware bench (blocked on items 1+2 above)** — `bash autoresearch lpc845brk --ws2812-loopback --upload-port COM10` with FASTLED_LPC_RX_SCT_WS2812=1 in the firmware build.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
…phase2 # Conflicts: # examples/AutoResearchLpc/AutoResearchLpc.ino
2 of 3 tasks
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.
Summary
Phase 2 of FastLED #3021 — adds the
ws2812SctTestJSON-RPC handler,--ws2812-loopbackautoresearch subcommand, and Python orchestrator for the WS2812 byte-match loopback. Stacked on top of #3024 (Phase 1) so the Phase 1 SCT capture path is the substrate.What ships
Sketch —
examples/AutoResearchLpc/AutoResearchLpc.inoNew
ws2812SctTesthandler gated behind#if defined(FASTLED_LPC_RX_SCT_WS2812)(default OFF; see flash blocker below). Patterns mirrorflexioObjectFledTest:TX uses the existing bit-bang
clockless_arm_lpc.hdriver viaFastLED.show()(the sync TX driver the issue specifies). RX uses the Phase-1 polling-modeLpcSctRxChannel. Decode goes through the standardfl::make4PhaseTiming+LpcSctRxChannel::decode()path. Returns CSVsuccess,test_case,num_leds,exp_bytes,dec_bytes,matched,mismatched,edges.Orchestrator —
ci/autoresearch/test_lpc_ws2812_loopback.pyMirrors
test_flexio_rx_objectfled.py. Sends each case, parses CSV, assertsmismatched == 0. Final summary prints a polling-vs-DMA reminder when fails are non-zero.Runner wiring —
ci/autoresearch/{args,phases}.py--ws2812-loopbackCLI flag._run_lpc_ws2812_loopback_tests()dispatcher routinglpc845brk + --ws2812-loopbackto the orchestrator.Two documented blockers for hardware acceptance
Both pre-existing, independent of #3021 itself, and tracked separately:
Blocker 1 — Polling SCT capture can't keep up with 800 kHz WS2812
The Phase-1
LpcSctRxChannel::pollOnce()measures ~2 µs per poll on M0+ @ 30 MHz; WS2812 sub-pulses are 400–850 ns. On real silicon this orchestrator will reportmismatched > 0until the SCT→DMA RX upgrade lands. That upgrade is the right Phase-3 follow-up — out of scope here so the Phase-2 contract can be reviewed and the orchestrator wiring can be verified independently.Blocker 2 — fl::json flash bloat (FastLED #3002)
#include <FastLED.h>adds 2–4 KB on top of the already-97%-full AutoResearchLpc bring-up sketch. TheFASTLED_LPC_RX_SCT_WS2812flag is therefore default OFF: today's bring-up sketch still fits the budget. When #3002 lands (fl::json soft-FP cleanup), the flag flips on for the lpc845brk fbuild target.Test plan
bash lintclean on all touched files (C++ + Python).ast.parsesyntax check passes.bash autoresearch lpc845brk --ws2812-loopback --upload-port COM10withFASTLED_LPC_RX_SCT_WS2812=1in the firmware build. Closes Phase 2 of feat(lpc): RX backend for LPC8xx via SCT input-capture — two-phase rollout #3021 once both blockers are resolved.Closing #3021
This PR + #3024 land the full Phase 1 + Phase 2 scope from the issue. The remaining hardware-validation step is tracked by the two blockers above. Once both are addressed:
bash autoresearch lpc845brk --pin-toggle-rx --upload-port COM10→ Phase 1 PASSbash autoresearch lpc845brk --ws2812-loopback --upload-port COM10→ Phase 2 PASS#3021 closes at that point.
🤖 Generated with Claude Code