Repository navigation
feat(autoresearch): wire LPUART driver into --lpuart and --all (refs #3023) - #3033
Conversation
…3023) Phase 2 of workstream A: extends the AutoResearch orchestration so the upcoming Teensy 4 LPUART clockless driver can be exercised end-to-end the moment the engine TU lands. Mirrors the FLEX_IO wiring pattern shipped in #3005. Changes: - `examples/AutoResearch/AutoResearchRemote.cpp:944` Add `else if (n == "LPUART") opts.mBus = fl::Bus::LPUART;` to the driver-name → Bus mapping. Bus::LPUART itself was reserved in #3026. - `ci/autoresearch/args.py` New `lpuart: bool` field on `Args`, new `--lpuart` argparse flag with a help string documenting the iMXRT1062 LPUART TX pin set (`{1, 8, 14, 17, 20, 24, 29, 35, 47, 48}`), and the `--all` help text is updated to mention `--lpuart` alongside `--flex-io`. - `ci/autoresearch/phases.py` `LPUART` added to the `--all` driver list and to the per-flag mapping. Adds an `lpuart_tx_pin = 1` override (LPUART6_TX, Teensy 4's default Serial2 TX) so AutoResearch pins the LPUART tests to a known-good pin when the user doesn't supply `--tx-pin` — analogous to the existing `flex_io_tx_pin = 6` override. - `ci/tests/test_autoresearch_phases.py` Add `lpuart=False` to `_make_args` defaults and include `LPUART` in the `test_all_drivers` expected set. Also patches a pre-existing unrelated breakage in `_make_args` (was missing `pin_toggle_rx` and `ws2812_loopback` after recent additions to `Args` — the test file failed with `TypeError: missing 2 required positional arguments`). Test plan: - [x] `uv run pytest ci/tests/test_autoresearch_phases.py -x -q` passes: 48 passed in 7.58s. - [ ] `bash autoresearch teensy40 --lpuart` becomes runnable once the `lpuart_peripheral_real.cpp.hpp` + engine TU land (workstream A Phase 1 follow-up). Refs #3023 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthroughAdds LPUART (Teensy 4.x clockless) driver support to the autoresearch CI test runner. The ChangesLPUART Driver Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ci/autoresearch/args.py`:
- Around line 248-252: In the help text for the "--lpuart" argument, remove the
redundant "pin pinned" phrasing. Replace the awkward phrase "pin pinned to
1=LPUART6_TX by default" with clearer wording such as "defaults to pin
1=LPUART6_TX" or "pinned to pin 1=LPUART6_TX by default" to improve clarity and
eliminate the repetitive language.
In `@examples/AutoResearch/AutoResearchRemote.cpp`:
- Line 945: Remove the assignment `opts.mBus = fl::Bus::LPUART` from the
conditional branch since the `fl::Bus` enum defined in `src/fl/channels/bus.h`
does not contain an `LPUART` enumerator (the enum ends at `STUB`). Either delete
this entire else-if branch for the "LPUART" case, or add the `LPUART` enumerator
to the `fl::Bus` enum definition and add a corresponding case in the `busName()`
function if you intend to support this bus type in this PR.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 91b27b28-e812-4d66-bf07-8c177a4ac5ba
📒 Files selected for processing (4)
ci/autoresearch/args.pyci/autoresearch/phases.pyci/tests/test_autoresearch_phases.pyexamples/AutoResearch/AutoResearchRemote.cpp
| driver_group.add_argument( | ||
| "--lpuart", | ||
| action="store_true", | ||
| help="Test only LPUART clockless driver (Teensy 4.x only; eDMA-backed UART TX; pin pinned to 1=LPUART6_TX by default, override with --tx-pin in {1,8,14,17,20,24,29,35,47,48})", | ||
| ) |
There was a problem hiding this comment.
Minor wording improvement: "pin pinned" is redundant.
Line 251's help text says "pin pinned to 1" which is awkward. Consider rewording to "defaults to pin 1=LPUART6_TX" or "pinned to pin 1=LPUART6_TX by default" for clarity.
✏️ Suggested rewording
driver_group.add_argument(
"--lpuart",
action="store_true",
- help="Test only LPUART clockless driver (Teensy 4.x only; eDMA-backed UART TX; pin pinned to 1=LPUART6_TX by default, override with --tx-pin in {1,8,14,17,20,24,29,35,47,48})",
+ help="Test only LPUART clockless driver (Teensy 4.x only; eDMA-backed UART TX; defaults to pin 1=LPUART6_TX, override with --tx-pin in {1,8,14,17,20,24,29,35,47,48})",
)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ci/autoresearch/args.py` around lines 248 - 252, In the help text for the
"--lpuart" argument, remove the redundant "pin pinned" phrasing. Replace the
awkward phrase "pin pinned to 1=LPUART6_TX by default" with clearer wording such
as "defaults to pin 1=LPUART6_TX" or "pinned to pin 1=LPUART6_TX by default" to
improve clarity and eliminate the repetitive language.
| else if (n == "UART") opts.mBus = fl::Bus::UART; | ||
| else if (n == "FLEX_IO") opts.mBus = fl::Bus::FLEX_IO; | ||
| else if (n == "OBJECT_FLED") opts.mBus = fl::Bus::OBJECT_FLED; | ||
| else if (n == "LPUART") opts.mBus = fl::Bus::LPUART; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify fl::Bus enum includes LPUART and busName() handles it
# Check Bus enum definition
echo "=== Checking fl::Bus enum for LPUART ==="
rg -n 'enum class Bus' -A 30 src/fl/channels/bus.h
echo ""
echo "=== Checking busName() switch for LPUART case ==="
rg -n 'inline const char\* busName' -A 50 src/fl/channels/bus.h | rg -C 3 'LPUART|return ""'Repository: FastLED/FastLED
Length of output: 3833
Remove fl::Bus::LPUART assignment — enum value does not exist.
Line 945 assigns opts.mBus = fl::Bus::LPUART, but the fl::Bus enum (defined in src/fl/channels/bus.h) does not include an LPUART enumerator. The enum ends at STUB, and busName() has no corresponding case, so this code will fail to compile or function. Either remove this line or include the LPUART enum definition in this PR.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/AutoResearch/AutoResearchRemote.cpp` at line 945, Remove the
assignment `opts.mBus = fl::Bus::LPUART` from the conditional branch since the
`fl::Bus` enum defined in `src/fl/channels/bus.h` does not contain an `LPUART`
enumerator (the enum ends at `STUB`). Either delete this entire else-if branch
for the "LPUART" case, or add the `LPUART` enumerator to the `fl::Bus` enum
definition and add a corresponding case in the `busName()` function if you
intend to support this bus type in this PR.
Summary
Phase 2 of workstream A in #3023: extends the AutoResearch orchestration so the upcoming Teensy 4 LPUART clockless driver can be exercised end-to-end the moment the engine TU lands. Mirrors the
--flex-iowiring pattern shipped in #3005.Changes
examples/AutoResearch/AutoResearchRemote.cpp:944— addselse if (n == "LPUART") opts.mBus = fl::Bus::LPUART;to the driver-name → Bus mapping.Bus::LPUARTitself was reserved in feat(channels): reserve Bus::LPUART enum slot (refs #3023) #3026.ci/autoresearch/args.py— newlpuart: boolfield onArgs, new--lpuartargparse flag with a help string documenting the iMXRT1062 LPUART TX pin set ({1, 8, 14, 17, 20, 24, 29, 35, 47, 48}), and the--allhelp text is updated to mention--lpuartalongside--flex-io.ci/autoresearch/phases.py—LPUARTadded to the--alldriver list and to the per-flag mapping. Adds anlpuart_tx_pin = 1override (LPUART6_TX, Teensy 4's default Serial2 TX) so AutoResearch pins the LPUART tests to a known-good pin when the user doesn't supply--tx-pin— analogous to the existingflex_io_tx_pin = 6override.ci/tests/test_autoresearch_phases.py— addslpuart=Falseto_make_argsdefaults and includesLPUARTin thetest_all_driversexpected set. Also patches a pre-existing unrelated breakage in_make_args(was missingpin_toggle_rxandws2812_loopbackafter recent additions toArgs— the test file was failing withTypeError: missing 2 required positional arguments).Test plan
uv run pytest ci/tests/test_autoresearch_phases.py -x -q→ 48 passed in 7.58s.bash autoresearch teensy40 --lpuartbecomes runnable once thelpuart_peripheral_real.cpp.hpp+ engine TU land (workstream A Phase 1 follow-up).Why ship Phase 2 before Phase 1 completes
Phase 2 is purely orchestration — the runtime sketch silently falls back to
Bus::AUTOuntil the LPUART engine registers itself with the channel manager. Landing the AutoResearch wiring early means the Phase 1 follow-up PR (real iMXRT register driver) doesn't need to touch the AutoResearch infrastructure at all, keeping that PR focused on the hardware-verified driver code.Refs #3023
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests