Skip to content

fix(lpc): FL_STATIC_ASSERT (not raw static_assert) in rx_sct_capture - #3538

Merged
zackees merged 1 commit into
masterfrom
fix/lpc-rx-fl-static-assert
Jul 1, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/lpc-rx-fl-static-assert

Conversation

@zackees

@zackees zackees commented Jul 1, 2026 •

Copy link
Copy Markdown
Member

Regression from #3535 — my vendor CMSIS base-address identity checks used raw static_assert(...). BannedMacrosChecker flags 5 violations with rationale "FL_STATIC_ASSERT keeps compile-time assertions portable on old embedded toolchains."

Fix: include fl/stl/static_assert.h and replace 5 static_assert sites with FL_STATIC_ASSERT.

Verification

  • bash test --cpp — 345/345 pass
  • FL_STATIC_ASSERTs still fire against LPC845 vendor CMSIS macros the same way
  • BannedMacrosChecker should now find 0 violations in this file

Refs: #3535 (introduced), #3517 Phase C.

Summary by CodeRabbit

  • Chores
    • Updated internal build-time checks for one supported hardware target.
    • No user-facing behavior or public API changes.

Regression from #3535 — the vendor CMSIS base-address identity checks used
raw `static_assert(...)`. `BannedMacrosChecker` flags 5 violations:

    static_assert(kSysconBase   == SYSCON_BASE,   ...)
    static_assert(kSwmBase      == SWM0_BASE,     ...)
    static_assert(kInputMuxBase == INPUTMUX_BASE, ...)
    static_assert(kSctBase      == SCT0_BASE,     ...)
    static_assert(kDmaBase      == DMA0_BASE,     ...)

Rationale (from the linter): `FL_STATIC_ASSERT` keeps compile-time
assertions portable on old embedded toolchains.

Fix: include `fl/stl/static_assert.h` and replace `static_assert` with
`FL_STATIC_ASSERT` — same semantics on modern compilers, macro-based
fallback on old ones.

## Verification

- `bash test --cpp` — 345/345 pass
- The `FL_STATIC_ASSERT`s still fire against LPC845 vendor CMSIS `<PERIPH>_BASE`
  macros the same way; behavior identical
- `BannedMacrosChecker` should now find 0 violations in this file

Refs: #3535 (introduced the regression), #3517 Phase C.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees merged commit 39bf794 into master Jul 1, 2026
8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 1, 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: 8f551c6c-9fc2-4aae-a796-74d0a6ce79bf

📥 Commits

Reviewing files that changed from the base of the PR and between d6e1daf and c2959c9.

📒 Files selected for processing (1)
  • src/platforms/arm/lpc/rx_sct_capture.cpp.hpp

📝 Walkthrough

Walkthrough

This change updates compile-time assertion checks in a single header file, replacing standard static_assert calls with FL_STATIC_ASSERT macro for LPC845 base-address constant validation, and adds the corresponding header include.

Changes

Static Assert Migration

Layer / File(s) Summary
FL_STATIC_ASSERT adoption
src/platforms/arm/lpc/rx_sct_capture.cpp.hpp
Includes fl/stl/static_assert.h and replaces static_assert calls with FL_STATIC_ASSERT for LPC845 kSysconBase constant validation, keeping the same comparisons and messages.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • FastLED/FastLED#3535: Also modifies src/platforms/arm/lpc/rx_sct_capture.cpp.hpp around static_assert-based validation of LPC845 base-address constants.
✨ 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/lpc-rx-fl-static-assert

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.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 1, 2026
@zackees
zackees deleted the fix/lpc-rx-fl-static-assert branch August 21, 2026 19:16
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