Skip to content

docs(rx/flexio): FlexIO RX backend docs + enum-comment refresh (Phase 4 of #2764) - #2770

Merged
zackees merged 2 commits into
masterfrom
feat/flexio-rx-docs-ci
Jun 5, 2026
Merged

zackees merged 2 commits into
masterfrom
feat/flexio-rx-docs-ci

Conversation

@zackees

@zackees zackees commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Phase 4 — the final phase — of #2764. Documents the FlexIO RX backend that the four previous PRs in the series brought up. No runtime behaviour changes.

File What changed
src/fl/channels/rx/types.h RxBackend::PLATFORM_DEFAULT doc note mentions FLEXIO as Teensy-4 opt-in; RxBackend::FLEXIO mentions which RPCs hardware-verify it
src/fl/channels/rx.h Matching RxDeviceType::PLATFORM_DEFAULT comment refresh
agents/docs/hardware-autoresearch.md New section: "FlexIO RX Backend (Teensy 4 — opt-in)" with selection examples, pin map, peripheral resource budget, and verification surface

What the new docs section covers

  1. How to select it — both C++ (RxBackend::FLEXIO) and Python (flexioRxBenchmark / flexioObjectFledTest RPCs)
  2. Pin map — Teensy pin → FLEXIO1 input → IOMUXC offsets, with instructions for adding new pins
  3. Peripheral resource budget — exactly which FLEXIO1 shifter/timer/clock the backend owns, and explicit notes on what it does NOT touch (FlexIO2 is the WS2812 TX driver's; FlexIO3 stays free)
  4. Verification surface — the two bench RPCs plus their acceptance criteria
  5. Default-switch caveat — PLATFORM_DEFAULT stays on FlexPWM; switching to FLEXIO is held back to a separate PR per the parent-issue plan

Intentionally NOT in this PR (per the #2764 plan)

Verification

  • ✅ C++ lint clean
  • Docs-only diff; no host-test or platform-build behaviour changes are possible from these specific edits

Refs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added comprehensive guide for opt-in FlexIO RX backend on Teensy 4.x, including pin configuration, resource allocation, and verification procedures.
    • Clarified platform default backend availability and feature support across platforms.
  • Tests

    • Enhanced test scripts with improved keyboard interrupt handling.

… 4 of #2764)

Final phase of #2764 — documents the new FlexIO RX backend now that
the skeleton (#2765), hardware (#2766), bench harness (#2767), and
ObjectFLED loopback (#2769) have all landed on master.

Three changes, all documentation-side; no runtime behaviour changes:

1. `src/fl/channels/rx/types.h`:
   - `RxBackend::PLATFORM_DEFAULT` comment now mentions FLEXIO as an opt-in
     alternative on Teensy 4 with a pointer to #2764.
   - `RxBackend::FLEXIO` comment notes that hardware verification ran via
     `flexioRxBenchmark` (1/10/100 kHz square wave) and
     `flexioObjectFledTest` (5-pattern ObjectFLED loopback).

2. `src/fl/channels/rx.h`:
   - Matching `RxDeviceType::PLATFORM_DEFAULT` comment refreshed.

3. `agents/docs/hardware-autoresearch.md`:
   - New top-level section "FlexIO RX Backend (Teensy 4 — opt-in)" covering:
     * How to select the backend in C++ and Python
     * Pin map (Teensy pin -> FLEXIO1 input -> IOMUXC offsets)
     * Peripheral resource budget (Shifter 0, Timer 0, DMA, FLEXIO1
       functional clock)
     * Verification surface (flexioRxBenchmark + flexioObjectFledTest with
       acceptance criteria)
     * Explicit note that `PLATFORM_DEFAULT` stays on FlexPWM until the
       follow-up default-switch PR

Intentionally NOT in this PR (per the #2764 parent-issue plan):
- Switching `PLATFORM_DEFAULT` to FLEXIO on Teensy 4 — separate PR after
  both backends are equally exercised in the dev-bench matrix.
- Adding `bash autoresearch teensy40 --rx-backend=flexio` to the nightly
  hardware test matrix — gated on the Teensy 4.1 RTV-silicone hardware
  issue (#2760) being resolved.

Verification:
- ✅ C++ lint clean
- Docs-only changes; no host-test regressions possible

Refs #2764

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR documents the opt-in FlexIO RX backend feature for Teensy 4.x through coordinated enum, header, and hardware guide updates. Supporting test infrastructure is updated to route Ctrl-C through the global interrupt handler.

Changes

FlexIO RX Backend Documentation and Testing

Layer / File(s) Summary
Test infrastructure — keyboard interrupt handling
ci/autoresearch/test_flexio_rx_objectfled.py
The FlexIO ObjectFLED RX test imports handle_keyboard_interrupt and updates exception handling to route Ctrl-C through the global interrupt mechanism before re-raising.
FlexIO RX backend enum, header, and hardware documentation
src/fl/channels/rx/types.h, src/fl/channels/rx.h, agents/docs/hardware-autoresearch.md
RxBackend and RxDeviceType enum documentation is updated to clarify platform defaults (RMT on ESP32, FlexPWM on Teensy 4) and the new opt-in FLEXIO option on Teensy 4. A new hardware guide section documents backend selection (C++ and Python), pin mapping, peripheral resource layout (FLEXIO1 shifter/timer, eDMA channel), and verification via new RPCs (flexioRxBenchmark, flexioObjectFledTest) with acceptance criteria.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2435: Both PRs route KeyboardInterrupt handling through the project-wide handle_keyboard_interrupt(...) mechanism in autoresearch test files.
  • FastLED/FastLED#2769: The retrieved PR introduces the FlexIO ObjectFLED RX test (test_flexio_rx_objectfled.py), which the main PR now updates with improved keyboard interrupt handling.
  • FastLED/FastLED#2401: The retrieved PR refactors the RX public interface in src/fl/channels/rx.h, which the main PR subsequently documents with updated comments about PLATFORM_DEFAULT and FLEXIO options.

Poem

A Teensy with FlexIO springs,
Now opt-in, with docs on its wings,
Keyboard interrupts flow,
Through handlers we know—
Testing smooth as a rabbit's soft flings! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title precisely matches the changeset: documentation additions for FlexIO RX backend and enum-comment updates across multiple files, with Phase 4 reference to the parent issue #2764.
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/flexio-rx-docs-ci

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.

…andler

PR #2769 introduced a `try/except KeyboardInterrupt` block on the serial-open
path of `test_flexio_rx_objectfled.py` that re-raised the signal directly.
The project-wide KBI002 lint requires that KeyboardInterrupt handlers either
call `_thread.interrupt_main()` or route through
`handle_keyboard_interrupt(ki)` from `ci.util.global_interrupt_handler`.

Importing the helper and calling it before the re-raise keeps the original
abort-without-stack-trace UX while satisfying the lint check.

The KBI002 violation was surfaced by the post-stop hook on the Phase 4
branch, which lints the master state pulled into the docs branch.

Refs #2764, PR #2769 review

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

@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.

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 `@src/fl/channels/rx.h`:
- Line 164: The enum comment for PLATFORM_DEFAULT contains non-ASCII punctuation
(e.g. an em-dash); update the comment attached to PLATFORM_DEFAULT so it uses
only 7-bit ASCII punctuation (replace em-dash with '-' or '--', any fancy
quotes/ellipses with plain ASCII equivalents) and ensure the entire comment text
is strictly ASCII.

In `@src/fl/channels/rx/types.h`:
- Around line 9-13: Update the header comments in src/fl/channels/rx/types.h to
use only 7-bit ASCII: replace any em-dashes, fancy quotes or other non-ASCII
punctuation in the enum comment block (lines referencing PLATFORM_DEFAULT, RMT,
ISR, FLEXPWM, FLEXIO and the FLEXIO comment text) with plain ASCII equivalents
(e.g., use "-" for em dash, "'" for quotes, and remove backticks), ensuring all
header-comment characters are 7-bit ASCII to comply with the src/fl/**/*.h rule.
🪄 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: 7388b4cb-8812-425b-a095-404f4ca6ec7f

📥 Commits

Reviewing files that changed from the base of the PR and between 565c5d5 and ab4d200.

📒 Files selected for processing (4)
  • agents/docs/hardware-autoresearch.md
  • ci/autoresearch/test_flexio_rx_objectfled.py
  • src/fl/channels/rx.h
  • src/fl/channels/rx/types.h

Comment thread src/fl/channels/rx.h
*/
enum class RxDeviceType : u8 {
PLATFORM_DEFAULT = 0, ///< Platform default (RMT on ESP32, FLEXPWM on Teensy 4.x)
PLATFORM_DEFAULT = 0, ///< Platform default (RMT on ESP32, FLEXPWM on Teensy 4.x; FLEXIO available as opt-in on Teensy 4 — see FastLED#2764)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Use ASCII-only punctuation in this updated enum comment.

The modified comment uses non-ASCII punctuation; this header path requires strictly 7-bit ASCII for comment-only updates.

As per coding guidelines, “for changes restricted to comments in headers under src/fl/**/*.h … source text is strictly 7-bit ASCII.”

🤖 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/rx.h` at line 164, The enum comment for PLATFORM_DEFAULT
contains non-ASCII punctuation (e.g. an em-dash); update the comment attached to
PLATFORM_DEFAULT so it uses only 7-bit ASCII punctuation (replace em-dash with
'-' or '--', any fancy quotes/ellipses with plain ASCII equivalents) and ensure
the entire comment text is strictly ASCII.

Comment on lines +9 to +13
PLATFORM_DEFAULT = 0, ///< Use the recommended backend for the active platform (RMT on ESP32; FlexPWM on Teensy 4.x with FLEXIO as an opt-in alternative — see FastLED#2764; native RX on stub/host builds).
RMT = 1, ///< ESP32-only RMT capture backend.
ISR = 2, ///< Platform-neutral interrupt-driven edge capture backend when available.
FLEXPWM = 3, ///< Teensy 4.x-only FlexPWM capture backend.
FLEXIO = 4 ///< Teensy 4.x-only FlexIO capture backend (FLEXIO1; FLEXIO2 is owned by the TX driver). See FastLED#2764.
FLEXIO = 4 ///< Teensy 4.x-only FlexIO capture backend (FLEXIO1 — FLEXIO2 is owned by the WS2812 TX driver). Hardware-verified by `flexioRxBenchmark` (1/10/100 kHz square wave) and `flexioObjectFledTest` (5-pattern ObjectFLED loopback). See FastLED#2764.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace Unicode punctuation in header comments with 7-bit ASCII.

These updated comments include non-ASCII punctuation (for example, em dash), which violates the header-comment ASCII rule for src/fl/**/*.h. Replace with plain ASCII characters (-, ', etc.).

As per coding guidelines, “for changes restricted to comments in headers under src/fl/**/*.h … source text is strictly 7-bit ASCII.”

🤖 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/rx/types.h` around lines 9 - 13, Update the header comments
in src/fl/channels/rx/types.h to use only 7-bit ASCII: replace any em-dashes,
fancy quotes or other non-ASCII punctuation in the enum comment block (lines
referencing PLATFORM_DEFAULT, RMT, ISR, FLEXPWM, FLEXIO and the FLEXIO comment
text) with plain ASCII equivalents (e.g., use "-" for em dash, "'" for quotes,
and remove backticks), ensuring all header-comment characters are 7-bit ASCII to
comply with the src/fl/**/*.h rule.

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