Repository navigation
feat(channels): reserve Bus::LPUART enum slot (refs #3023) - #3026
Conversation
Adds the `LPUART` enumerator to `fl::Bus` for the future Teensy 4.x iMXRT1062 LPUART (inverted-TX + eDMA) clockless driver, wires the matching `busName()` case, and bumps the drift-prevention static_assert to track the new last value (`Bus::STUB` is now position 14). This is the foundational sub-step of workstream A in the #3023 meta issue. No driver code is added yet — the slot reservation lets the follow-up driver PRs (peripheral interface, wave8 encoder, channel engine, registration) land without conflicting on bus.h. Refs #3023 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
📝 WalkthroughWalkthrough
ChangesLPUART Bus Addition
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
🧹 Nitpick comments (1)
src/fl/channels/bus.h (1)
73-73: Future work: AddBus::LPUARTpriority mapping when the driver is implemented.When the LPUART driver is implemented in follow-up PRs, remember to add a priority entry for
Bus::LPUARTin thedefault_bus_priority(Bus)function insrc/fl/channels/bus_priorities.h. Currently, it falls back to the default priority of 0, which is safe for a reserved-but-unimplemented slot.Also applies to: 181-181, 191-191
🤖 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 `@src/fl/channels/bus.h` at line 73, When the LPUART driver is fully implemented in follow-up PRs, add a priority mapping entry for Bus::LPUART in the default_bus_priority(Bus) function to assign it an appropriate priority level instead of using the default priority of 0. This ensures the LPUART driver has the correct scheduling priority alongside other implemented bus drivers.
🤖 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.
Nitpick comments:
In `@src/fl/channels/bus.h`:
- Line 73: When the LPUART driver is fully implemented in follow-up PRs, add a
priority mapping entry for Bus::LPUART in the default_bus_priority(Bus) function
to assign it an appropriate priority level instead of using the default priority
of 0. This ensures the LPUART driver has the correct scheduling priority
alongside other implemented bus drivers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 01c40ca0-4351-447d-b34e-087c7098b1ec
📒 Files selected for processing (1)
src/fl/channels/bus.h
…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]>
Summary
Reserves the
LPUARTenumerator onfl::Busfor the future Teensy 4.xiMXRT1062 LPUART (inverted-TX + eDMA) clockless driver. Wires the
matching
busName()case and bumps the drift-prevention static_assertso
Bus::STUBis now tracked at position 14.This is the foundational sub-step of workstream A in #3023. No driver
code is added yet — the slot reservation lets the follow-up driver PRs
(peripheral interface, wave8 encoder, channel engine, registration)
land without conflicting on
bus.h.Changes
src/fl/channels/bus.h:Bus::LPUARTbetweenOBJECT_FLEDandBIT_BANG.case Bus::LPUART: return "LPUART";tobusName().FL_STATIC_ASSERT(static_cast<fl::u8>(Bus::STUB) == ...)from13→14.Test plan
FL_STATIC_ASSERTinbus.h(catches the drift).fl_channels_bus_traitshost test passes (exit 0).bash lint --cpppasses.Bus::outsidebusName()needupdating (only
bus.hitself depends on the exhaustive set).Refs #3023
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes