Skip to content

feat(rp2040): capture PIO RX durations with DMA - #3664

Merged
zackees merged 1 commit into
masterfrom
feat/rp2040-phase2-pio-rx-detect
Jul 15, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/rp2040-phase2-pio-rx-detect

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Implements the dependent Phase 2/3 RP2040 RX bring-up work: start-level-gated PIO duration counters, DMA-paced one-word-per-edge capture, calibrated instruction-path timing, glitch/skip/capacity/saturation handling, reset-tail completion, and host tests.\n\nCloses #3655\nCloses #3656\n\nValidation: �ash test fl_channels_rx --debug; uv run --no-sync python ci/lint_cpp/run_all_checkers.py --no-rust. RP2040 fbuild compilation remains blocked by FastLED/fbuild#1040 (documented there); no alternate build/upload tool was used.

Summary by CodeRabbit

  • New Features

    • Added RP2040/RP2350 PIO duration-based signal capture for more accurate edge timing.
    • Added configurable minimum-duration filtering and optional initial-signal skipping.
    • Improved handling of signal transitions, idle tails, and capture completion.
    • Added protection against capture-buffer overflow and saturation.
  • Bug Fixes

    • Improved validation for buffer sizes and supported pin ranges.
    • Improved cleanup and reset behavior when stopping captures.

@zackees
zackees merged commit 2fda0c6 into master Jul 15, 2026
6 of 9 checks passed
@zackees
zackees deleted the feat/rp2040-phase2-pio-rx-detect branch July 15, 2026 12:01
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b7909d2a-7529-499d-8f14-57799377cb82

📥 Commits

Reviewing files that changed from the base of the PR and between 7b58298 and c7d51c1.

📒 Files selected for processing (4)
  • src/platforms/arm/rp/rpcommon/rp_pio_edge_capture.h
  • src/platforms/arm/rp/rpcommon/rx_pio_channel.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rx_pio_channel.h
  • tests/fl/channels/rx.cpp

📝 Walkthrough

Walkthrough

Adds RpPioEdgeCapture for converting PIO counters into filtered edge durations, integrates a relocated RP PIO duration program with DMA capture, and adds lifecycle handling plus host tests for conversion, filtering, skipping, capacity, and saturation.

Changes

RP PIO Edge Capture

Layer / File(s) Summary
Edge duration conversion and validation
src/platforms/arm/rp/rpcommon/rp_pio_edge_capture.h, tests/fl/channels/rx.cpp
RpPioEdgeCapture converts counters, filters glitches, skips initial phases, merges matching edges, enforces capacity, reports saturation, and is covered by host tests.
PIO program installation and capture setup
src/platforms/arm/rp/rpcommon/rx_pio_channel.cpp.hpp, src/platforms/arm/rp/rpcommon/rx_pio_channel.h
RpPioRxDevice builds and relocates the duration program, validates inputs, configures PIO and DMA, and stores expanded capture state.
DMA collection and capture finalization
src/platforms/arm/rp/rpcommon/rx_pio_channel.cpp.hpp
Capture advancement collects DMA words, appends durations, finalizes idle tails, handles overflow, and updates stop/wait/decode behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RpPioRxDevice
  participant PIOStateMachine
  participant DMA
  participant RpPioEdgeCapture
  RpPioRxDevice->>PIOStateMachine: start duration program
  PIOStateMachine->>DMA: stream RX FIFO duration counters
  RpPioRxDevice->>DMA: collect transferred words
  RpPioRxDevice->>RpPioEdgeCapture: append counter durations
  RpPioEdgeCapture-->>RpPioRxDevice: return edge timings or saturation
  RpPioRxDevice->>PIOStateMachine: finalize idle tail and stop
Loading

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3663 — Introduces the related RP PIO RX lifecycle backend and RpPioRxDevice plumbing.
✨ 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/rp2040-phase2-pio-rx-detect

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.

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