Skip to content

test(spi): give the SoftwareSPIOutput wrapper test a rate in Hz after the stub joined the ESP32 branch - #5415

Merged
zackees merged 1 commit into
masterfrom
fix/fastspi-test-stub-hz
Nov 22, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/fastspi-test-stub-hz

Conversation

@zackees

@zackees zackees commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

#5411 made the host stub use the ESP32 Hz-based SoftwareSPIOutput wrapper, while the test added by #5408 still passed the literal divider 2. That trips both the minimum-rate guard and the stale base-class assertion on master.

Request 10 MHz through DATA_RATE_MHZ and assert that the public wrapper derives from GenericSoftwareSPIOutput with the real Hz-to-divider mapping. At the stub's 1 GHz CPU clock this is divider 100. This preserves the #5051 mapping and every existing waveform assertion: all 256 byte values, eight rising edges per byte, chip-select boundaries, and the 25-edge RGB/start-bit layout. Production code is unchanged.

Validation:

  • RED: bash test fastspi and debug diagnostics reproduce the compile failure on master e7374e8b6.
  • GREEN: bash test fastspi and bash test fastspi --debug pass.
  • bash lint passes.
  • Full bash test --cpp passes: 377 unit targets and 97 examples.

Summary by CodeRabbit

  • Tests
    • Expanded compile-time validation of software SPI output configurations using dividers derived from the requested data rate and CPU frequency.
    • Added a check that the software SPI output type uses the corresponding generic output configuration, strengthening coverage of rate-dependent setup behavior.

… the stub joined the ESP32 branch

Follow up #5408 and #5411: the host stub now shares the ESP32 Hz-to-divider mapping from #5051. Keep all byte, edge-count, chip-select and start-bit assertions intact.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

The wrapper type check now derives a divider from a 10 MHz rate and FL_CPU_FREQUENCY(). It verifies that SoftwareSPIOutput inherits from the matching GenericSoftwareSPIOutput specialization.

Changes: Software SPI rate check

Layer / File(s) Summary
Wrapper type assertion
tests/unit/fastspi.cpp
The compile-time check derives the divider from DATA_RATE_MHZ(10) and FL_CPU_FREQUENCY(), then checks inheritance from the corresponding GenericSoftwareSPIOutput specialization.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related issues

Possibly related PRs

Merge Risk: Minimal · up to 1dc09

This updates a unit test to match the host stub's Hz-based SPI wrapper. It does not change production behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the test change (test(spi)) and the SoftwareSPIOutput wrapper test. It also states the cause: the test now supplies a rate in Hz because the stub joined the ESP32 branch. The change se…
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.
Full details: Title check

Explanation

The title names the test change (test(spi)) and the SoftwareSPIOutput wrapper test. It also states the cause: the test now supplies a rate in Hz because the stub joined the ESP32 branch. The change set matches this: the test swaps the old divider pass-through for DATA_RATE_MHZ(10) and bitbangDividerFromHz with FL_CPU_FREQUENCY(), and checks inheritance from GenericSoftwareSPIOutput. The title is long (102 characters), but it describes the main change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cbe7b61 and 1dc094c.

Files selected for processing: 1

  • tests/unit/fastspi.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions github-actions Bot added the sanitized Title, body and conversation screened; review text requires separate screening. label Nov 22, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 22, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 22, 2026
@zackees
zackees added this pull request to the merge queue Nov 22, 2026
Merged via the queue into master with commit 01119e2 Nov 22, 2026
130 checks passed
@zackees
zackees deleted the fix/fastspi-test-stub-hz branch November 22, 2026 05:35
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant