Skip to content

feat(channels): reserve Bus::LPUART enum slot (refs #3023) - #3026

Merged
zackees merged 1 commit into
masterfrom
feat/lpuart-bus-enum
Jun 14, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/lpuart-bus-enum

Conversation

@zackees

@zackees zackees commented Jun 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Reserves the LPUART enumerator on 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
so Bus::STUB is 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:
    • Add Bus::LPUART between OBJECT_FLED and BIT_BANG.
    • Add case Bus::LPUART: return "LPUART"; to busName().
    • Bump FL_STATIC_ASSERT(static_cast<fl::u8>(Bus::STUB) == ...) from
      13 → 14.

Test plan

  • Compile-time invariants enforced via the existing
    FL_STATIC_ASSERT in bus.h (catches the drift).
  • fl_channels_bus_traits host test passes (exit 0).
  • bash lint --cpp passes.
  • No exhaustive switches on Bus:: outside busName() need
    updating (only bus.h itself depends on the exhaustive set).

Refs #3023

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for Teensy 4.x LPUART clockless driver, enabling an additional bus option for compatible devices.

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]>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Bus::LPUART (Teensy 4.x LPUART clockless driver) is added to the fl::Bus enum in src/fl/channels/bus.h. The busName() switch gains a matching "LPUART" case, and the FL_STATIC_ASSERT guarding Bus::STUB's ordinal is updated from 13 to 14 to reflect the shifted enum layout.

Changes

LPUART Bus Addition

Layer / File(s) Summary
Bus::LPUART enum value, name mapping, and assertion update
src/fl/channels/bus.h
Bus::LPUART is inserted into the fl::Bus enum, busName() is extended with a Bus::LPUART → "LPUART" case, and the FL_STATIC_ASSERT for Bus::STUB's numeric value is updated from 13 to 14.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2429: Directly extends the same fl::Bus enum and busName() mapping in src/fl/channels/bus.h that this PR builds upon.
  • FastLED/FastLED#2575: Also modifies src/fl/channels/bus.h's fl::Bus enum and busName() switch, adding preprocessor guards against macro collision in the same file.

Poem

🐇 A new bus has joined the parade,
LPUART, in enum arrayed!
The switch case now gleams,
The assertion agrees,
And STUB shifts, undismayed! 🚌✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(channels): reserve Bus::LPUART enum slot (refs #3023)' directly and specifically describes the main change: adding a new Bus::LPUART enumerator to reserve an enum slot for a future driver implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lpuart-bus-enum

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/fl/channels/bus.h (1)

73-73: Future work: Add Bus::LPUART priority mapping when the driver is implemented.

When the LPUART driver is implemented in follow-up PRs, remember to add a priority entry for Bus::LPUART in the default_bus_priority(Bus) function in src/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

📥 Commits

Reviewing files that changed from the base of the PR and between 6157361 and 347cc65.

📒 Files selected for processing (1)
  • src/fl/channels/bus.h

zackees added a commit that referenced this pull request Jun 14, 2026
…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]>
@zackees
zackees merged commit 0d1e22f into master Jun 14, 2026
9 of 10 checks passed
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 14, 2026
@zackees
zackees deleted the feat/lpuart-bus-enum branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant