Skip to content

refactor(lpc): rename FL_LPC* macros to FL_IS_ARM_LPC_* (closes #2999) - #3017

Merged
zackees merged 1 commit into
masterfrom
feat/2999-lpc-macro-rename
Jun 14, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/2999-lpc-macro-rename

Conversation

@zackees

@zackees zackees commented Jun 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Brings the LPC subtype macros in line with the project-wide FL_IS_<FAMILY>_<SUBTYPE> naming convention used everywhere else (FL_IS_TEENSY_LC, FL_IS_STM32_F1, FL_IS_ESP8266, FL_IS_SAMD21, ...). Only the family roll-up FL_IS_ARM_LPC was previously compliant.

Rename

Old (wrong) New (correct)
FL_LPC845 FL_IS_ARM_LPC_845
FL_LPC804 FL_IS_ARM_LPC_804
FL_LPC11 FL_IS_ARM_LPC_11
FL_LPC11_USB FL_IS_ARM_LPC_11_USB
FL_LPC11_LEGACY FL_IS_ARM_LPC_11_LEGACY
FL_LPC15 FL_IS_ARM_LPC_15

Scope

Touched 9 files, all under src/platforms/arm/lpc/. No backward-compat aliases needed — the FL_LPC* names were entirely internal to that directory (zero references in src/ outside it, zero in examples/, tests/, or ci/). Verified zero-occurrence post-rename with a project-wide grep -rn.

Upstream toolchain / vendor inputs (__LPC845__, LPC845M301, CPU_LPC845M301JBD48, ...) are explicitly NOT renamed — we read them, we don't define them.

fastled_arm_lpc.h gained a #include "platforms/arm/is_arm.h" to satisfy the IsHeaderIncludeChecker lint (which requires any file using an FL_IS_* macro to pull in the trampoline include).

Test plan

  • bash lint — clean (was 1 IsHeaderIncludeChecker violation pre-fix, now 0).
  • bash autoresearch lpc845brk --upload-port COM10 --skip-lint --timeout 5 — LPC845 firmware builds (text 62.16 KB / 64 KB), flashes via pyOCD, and the existing bring-up RPC test passes on real hardware:
    • ✅ Serial.println — REMOTE: response received
    • ✅ JSON-RPC echo — sentinel 4242 round-trip verified
    • ✅ FL_WARN_LIT — FastLED warn pipeline reached host
  • bash test --cpp — 219/219 host test cases pass (a separate intermittent zccache-daemon link race surfaced "0/0 tests built" on one run — that's the false-pass / false-fail mode tracked by test runner produces false-pass when link fails (zccache daemon crash under all-with-examples) #3011 and is independent of this change; the second invocation after zccache stop returned clean test pass counts).

Closes #2999.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Standardized LPC platform detection macro naming across all LPC headers for device detection and feature gating in LPC845, LPC804, LPC11xx, and LPC15xx families.

…vention

Brings the LPC subtype macros in line with the project-wide
`FL_IS_<FAMILY>_<SUBTYPE>` naming convention used everywhere else
(`FL_IS_TEENSY_LC`, `FL_IS_STM32_F1`, `FL_IS_ESP8266`, `FL_IS_SAMD21`,
...). Only the family roll-up `FL_IS_ARM_LPC` was previously compliant.

Renamed (table per the issue body):

| Old (wrong)        | New (correct)            |
|--------------------|--------------------------|
| `FL_LPC845`        | `FL_IS_ARM_LPC_845`      |
| `FL_LPC804`        | `FL_IS_ARM_LPC_804`      |
| `FL_LPC11`         | `FL_IS_ARM_LPC_11`       |
| `FL_LPC11_USB`     | `FL_IS_ARM_LPC_11_USB`   |
| `FL_LPC11_LEGACY`  | `FL_IS_ARM_LPC_11_LEGACY`|
| `FL_LPC15`         | `FL_IS_ARM_LPC_15`       |

Touched 9 files, all under `src/platforms/arm/lpc/`:

  * `is_lpc.h` — source of truth: 6 `#define`s renamed, sub-family
    roll-up `#if defined(...)` updated, header banner extended with a
    short convention note referencing #2999. Upstream toolchain /
    vendor inputs (`__LPC845__`, `LPC845M301`, `CPU_LPC845M301JBD48`,
    etc.) are explicitly NOT renamed — we read them, we don't define
    them.
  * `clockless_arm_lpc.h`, `clockless_arm_lpc_plu.h`,
    `clockless_arm_lpc_pwm_dma.h`, `fastled_arm_lpc.h`,
    `fastpin_arm_lpc.h`, `led_sysdefs_arm_lpc.h`, `spi_arm_lpc.h`,
    `README.md` — `defined(FL_LPC*)` consumers and prose references
    updated. No semantic change; the conditions evaluate to the same
    truth values they did before.
  * `fastled_arm_lpc.h` — added `#include "platforms/arm/is_arm.h"`
    so the `IsHeaderIncludeChecker` is satisfied (the rename means
    the file now uses `FL_IS_*` macros, which require the trampoline
    include).

No backward-compat aliases needed — the `FL_LPC*` names were internal
to `src/platforms/arm/lpc/` (zero references in `src/` outside that
directory, zero in `examples/`, `tests/`, or `ci/`). Verified
zero-occurrence post-rename with a project-wide grep.

Closes #2999.

Test plan:

  * `bash lint` — clean (was 1 violation pre-fix-the-include, now 0).
  * `bash autoresearch lpc845brk --upload-port COM10 --skip-lint
    --timeout 5` — LPC845 firmware builds (text 62.16 KB / 64 KB),
    flashes via pyOCD, and the existing bring-up RPC test still
    passes on real hardware:
      ✅ Serial.println — REMOTE: response received
      ✅ JSON-RPC echo  — sentinel 4242 round-trip verified
      ✅ FL_WARN_LIT    — FastLED warn pipeline reached host
  * `bash test --cpp` — 219/219 host test cases pass (a separate
    intermittent zccache-daemon link race surfaced "0/0 tests built"
    on one run — that's the false-pass / false-fail mode tracked by
    #3011 and is independent of this change; the second invocation
    after `zccache stop` returned clean test pass counts).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 14, 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: 700ded46-f849-4d8f-aaac-6215955fdef4

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9fd45 and 43ef43f.

📒 Files selected for processing (9)
  • src/platforms/arm/lpc/README.md
  • src/platforms/arm/lpc/clockless_arm_lpc.h
  • src/platforms/arm/lpc/clockless_arm_lpc_plu.h
  • src/platforms/arm/lpc/clockless_arm_lpc_pwm_dma.h
  • src/platforms/arm/lpc/fastled_arm_lpc.h
  • src/platforms/arm/lpc/fastpin_arm_lpc.h
  • src/platforms/arm/lpc/is_lpc.h
  • src/platforms/arm/lpc/led_sysdefs_arm_lpc.h
  • src/platforms/arm/lpc/spi_arm_lpc.h

📝 Walkthrough

Walkthrough

All LPC platform-detection macros in src/platforms/arm/lpc/is_lpc.h are renamed from the legacy FL_LPC* scheme to the FL_IS_ARM_LPC_* naming convention. The new names are propagated consistently to all downstream LPC headers (led_sysdefs, fastpin, clockless, clockless_plu, clockless_pwm_dma, spi, fastled_arm_lpc) and the README.

Changes

LPC Platform Macro Rename

Layer / File(s) Summary
is_lpc.h: macro definitions and naming convention
src/platforms/arm/lpc/is_lpc.h
Adds naming-convention documentation and renames all seven LPC detection macros: FL_LPC845→FL_IS_ARM_LPC_845, FL_LPC804→FL_IS_ARM_LPC_804, FL_LPC11_USB→FL_IS_ARM_LPC_11_USB, FL_LPC11_LEGACY→FL_IS_ARM_LPC_11_LEGACY, FL_LPC11→FL_IS_ARM_LPC_11, FL_LPC15→FL_IS_ARM_LPC_15, and FL_LPC→FL_IS_ARM_LPC.
CPU class, clock, and wiring
src/platforms/arm/lpc/led_sysdefs_arm_lpc.h, src/platforms/arm/lpc/fastled_arm_lpc.h
led_sysdefs_arm_lpc.h updates M0/M0+ selection, F_CPU defaults, and SoC device header includes to reference FL_IS_ARM_LPC_*. fastled_arm_lpc.h adds is_arm.h include, updates driver selection to FL_IS_ARM_LPC_845, and adds comments for FL_IS_ARM_LPC_15 and FL_IS_ARM_LPC_11_LEGACY.
Driver header compile guards
src/platforms/arm/lpc/fastpin_arm_lpc.h, src/platforms/arm/lpc/clockless_arm_lpc.h, src/platforms/arm/lpc/clockless_arm_lpc_plu.h, src/platforms/arm/lpc/clockless_arm_lpc_pwm_dma.h, src/platforms/arm/lpc/spi_arm_lpc.h
All #if guards and #endif comments updated to use FL_IS_ARM_LPC_* macros across fastpin (legacy/modern chip allowlist), clockless (adds FL_IS_ARM_LPC_11_USB), PLU (LPC804 opt-in), PWM+DMA (LPC845 opt-in), and SPI (LPC845/LPC804 device guard).
README documentation
src/platforms/arm/lpc/README.md
Three lines updated to reference FL_IS_ARM_LPC_11, FL_IS_ARM_LPC_15, and the full FL_IS_ARM_LPC_* macro list in the Cortex-M description, is_lpc.h macro table, and fbuild board note.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • #2999 — This PR directly implements the macro-renaming convention mandated in issue #2999, renaming all FL_LPC* subtype macros to FL_IS_ARM_LPC_* across all 9 affected files.

Possibly related PRs

  • FastLED/FastLED#2849: Also modifies src/platforms/arm/lpc/is_lpc.h to extend LPC11 detection macros, directly preceding this renaming work.
  • FastLED/FastLED#2850: Introduces clockless_arm_lpc_pwm_dma.h under FL_LPC845, the exact guard this PR renames to FL_IS_ARM_LPC_845.
  • FastLED/FastLED#2872: Modifies the same set of LPC platform headers (is_lpc.h, fastpin_arm_lpc.h, clockless_arm_lpc.h, led_sysdefs_arm_lpc.h) introducing the LPC11Uxx/LPC15xx gating that this PR renames.

Poem

🐇 A rabbit tidied up the names one day,
FL_LPC* was swept away—
FL_IS_ARM_LPC_845 now stands tall,
A consistent convention for one and all!
The macros all march in a neat little row,
No legacy names left to confuse the show. ✨

✨ 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/2999-lpc-macro-rename

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.

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.

convention: platform (sub)type macros must follow FL_IS_<PLATFORM> (e.g. FL_IS_ARM_LPC_845, not FL_LPC845)

1 participant