Skip to content

fix(rp): share Channels bus holders safely - #3849

Merged
zackees merged 1 commit into
masterfrom
fix/rp-pio-peripheral-mocks
Aug 6, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/rp-pio-peripheral-mocks

Conversation

@zackees

@zackees zackees commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary\n- replace RP PIO/SPI/UART function-local bus holder state with header-safe l::SingletonShared instances\n- provide reusable, isolated RP PIO TX/SPI peripheral mocks and use them in lifecycle tests\n- pin FastLED to fbuild 2.5.14, including selected-device RP deployment protection\n\n## Verification\n- �ash test --unit channel_engine_rp_pio --no-interactive --no-fingerprint\n- �ash lint --cpp --strict on all touched C++ files\n- �ash compile rp2350w AutoResearch --no-interactive\n\nRefs #3832

Summary by CodeRabbit

  • Tests

    • Added reusable host-test mocks for RP PIO transmit and SPI peripherals.
    • Expanded validation of DMA behavior, configuration, failure handling, timing, cleanup, and captured data.
    • Improved coverage for RP platform bus and driver interactions.
  • Refactor

    • Standardized RP PIO, SPI, and UART driver instance management for more consistent behavior.
  • Chores

    • Updated the fbuild build dependency to version 2.5.14.

@zackees
zackees merged commit af97829 into master Aug 6, 2026
15 of 17 checks passed
@zackees
zackees deleted the fix/rp-pio-peripheral-mocks branch August 6, 2026 06:23
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 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 Plus

Run ID: 3a144ef4-b1b8-44ed-8968-3815f4df44f0

📥 Commits

Reviewing files that changed from the base of the PR and between a209dcf and b637277.

📒 Files selected for processing (6)
  • pyproject.toml
  • src/platforms/arm/rp/rpcommon/rp_pio_peripheral_mock.h
  • src/platforms/arm/rp/rpcommon/rp_pio_tx_bus_traits.h
  • src/platforms/arm/rp/rpcommon/rp_spi_bus_traits.h
  • src/platforms/arm/rp/rpcommon/rp_uart_bus_traits.h
  • tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp

📝 Walkthrough

Walkthrough

The PR updates fbuild to 2.5.14. It adds shared RP PIO TX and SPI mocks, changes RP bus instance storage to SingletonShared, and updates channel-engine tests to use the shared mocks.

Changes

Build dependency update

Layer / File(s) Summary
Update fbuild pin
pyproject.toml
The documented pin history and required dependency now use fbuild==2.5.14.

RP peripheral test infrastructure

Layer / File(s) Summary
Add shared RP peripheral mocks
src/platforms/arm/rp/rpcommon/rp_pio_peripheral_mock.h
Adds TX and SPI mocks with configurable outcomes, lifecycle state, counters, timing, and DMA word capture.
Refactor RP bus instance access
src/platforms/arm/rp/rpcommon/rp_pio_tx_bus_traits.h, src/platforms/arm/rp/rpcommon/rp_spi_bus_traits.h, src/platforms/arm/rp/rpcommon/rp_uart_bus_traits.h
RP PIO, SPI, and UART holders use SingletonShared; UART holders bind the UART index at compile time.
Adopt shared mocks in channel-engine tests
tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp
Tests use shared TX and SPI mocks for configuration, DMA, completion, cleanup, driver-name, and pin-pair checks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3666 — Introduces RP PIO bus structures that this PR refactors and tests with shared mocks.
  • FastLED/FastLED#3672 — Adds RP SPI testing infrastructure supported by this PR’s shared mocks and singleton access.
  • FastLED/FastLED#3840 — Updates the same fbuild pin-history and dependency declaration.
✨ 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 fix/rp-pio-peripheral-mocks

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