Skip to content

feat(platform): LPC15xx (Cortex-M3) family detection scaffold (#2845 Stage 4 item 2) - #2859

Merged
zackees merged 1 commit into
masterfrom
feat/lpc15-detection-scaffold
Jun 6, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/lpc15-detection-scaffold

Conversation

@zackees

@zackees zackees commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage 4 item 2 from #2845. Mirrors the LPC11xx scaffold (#2849) for the LPC15xx (Cortex-M3) family. Pure header-detection scaffold — adds an FL_LPC15 macro and rolls it into FL_IS_ARM_LPC so the existing is_arm.h dispatch picks LPC15xx up automatically. Driver wiring (led_sysdefs_arm_lpc15.h, fastpin_arm_lpc15.h, M3-class clockless) is a follow-up.

Critical architectural note (also in the code comments)

LPC15xx is Cortex-M3, not M0 / M0+. The M3 has a barrel shifter and the full Thumb-2 instruction set, so this family must NOT be gated on FL_IS_ARM_M0 or FL_IS_ARM_M0_PLUS — the M0 ASM template's load/store offset encoding restrictions do not apply, and the follow-up clockless driver should target an M3-class path (tighter cycle counts than M0+ permits).

Detected variants

  • LPC1517 / LPC1518 / LPC1519 (M3, USART/SPI/I2C)
  • LPC1547 / LPC1548 / LPC1549 (M3, adds CAN + USB)

Common MCUXpresso / CMSIS CPU_* identifiers plus bare-project __LPC15xx__ / LPC15xx defines.

Files

File Change
src/platforms/arm/lpc/is_lpc.h +31 lines: FL_LPC15 block + roll-up extension

Test plan

  • bash lint --cpp passes (no new violations).
  • Header-only; existing LPC8xx / LPC11xx detection unchanged.
  • CI confirms no regressions on existing platforms.

Cross-references

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for the LPC15xx (Cortex-M3) microcontroller family, enabling proper platform detection and initialization for this processor variant.

Stage 4 item 2 from #2845. Adds NXP LPC15xx family
detection to is_lpc.h, mirroring the LPC11xx scaffold (#2849):

  - New FL_LPC15 macro keyed on __LPC15xx__, LPC15xx, and CMSIS-style
    CPU_LPC1517*/LPC1518*/LPC1519*/LPC1547*/LPC1548*/LPC1549* IDs.
  - FL_IS_ARM_LPC roll-up extended to include FL_LPC15 so the existing
    is_arm.h dispatch picks up LPC15xx as an ARM platform automatically.

Critical architectural note (also in code comments): LPC15xx is
Cortex-M3, not M0 / M0+. The M3 has a barrel shifter and the full
Thumb-2 instruction set, so this family must NOT be gated on
FL_IS_ARM_M0 or FL_IS_ARM_M0_PLUS — the M0 ASM template's load/store
offset encoding restrictions do not apply. The follow-up clockless
driver will target an M3-class path.

This PR is intentionally header-detection-only: the family compiles to
a stub on LPC15xx until the follow-up driver lands. Existing LPC8xx /
LPC11xx builds are unaffected (FL_LPC845/FL_LPC804/FL_LPC11 detection
unchanged).

Refs #2845, #2836, #2831

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94c1be5a-8253-440e-b0f3-22646d42a3e8

📥 Commits

Reviewing files that changed from the base of the PR and between 4c31af9 and 9dd10a6.

📒 Files selected for processing (1)
  • src/platforms/arm/lpc/is_lpc.h

📝 Walkthrough

Walkthrough

This PR adds compile-time detection for LPC15xx (Cortex-M3) microcontroller devices by introducing a new FL_LPC15 macro and integrating it into the existing FL_IS_ARM_LPC platform gating condition. The change adds 31 lines to the LPC platform detection header.

Changes

LPC15xx Platform Detection

Layer / File(s) Summary
LPC15xx detection and platform integration
src/platforms/arm/lpc/is_lpc.h
FL_LPC15 macro is defined when __LPC15xx__, LPC15xx, or specific CPU_LPC15xx device-header defines are present. The FL_IS_ARM_LPC roll-up conditional is extended to include FL_LPC15 alongside existing LPC804, LPC845, and LPC11 families.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly Related PRs

  • FastLED/FastLED#2849: Both PRs modify src/platforms/arm/lpc/is_lpc.h to extend the FL_IS_ARM_LPC roll-up logic by adding a new LPC family-specific macro within the same header-level detection structure.
  • FastLED/FastLED#2837: Both PRs directly modify the LPC device-detection macros and FL_IS_ARM_LPC roll-up conditions in the same file.
  • FastLED/FastLED#2848: This PR's addition of FL_LPC15 to FL_IS_ARM_LPC affects compilation guards that reference the platform detection macro in the LPC driver paths.

Poem

🐰 A rabbit's hop through silicon streams,
LPC15 joins the ARM device dreams,
With macros aligned in their neat compile dance,
More chips light up—what a luminous chance! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding LPC15xx family detection support to the platform detection scaffolding, with appropriate technical precision.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/lpc15-detection-scaffold

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.

@zackees
zackees merged commit 135ddc4 into master Jun 6, 2026
7 checks passed
@zackees zackees mentioned this pull request Jun 6, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 6, 2026
pull Bot pushed a commit to manmuqingshan/FastLED that referenced this pull request Jun 6, 2026
Tighten the family gates so `_ARMPIN` and the bit-banged `ClocklessController`
in `src/platforms/arm/lpc/` activate only for LPC845 / LPC804 instead of any
`FL_IS_ARM_LPC` build. With LPC11xx (Cortex-M0) and LPC15xx (Cortex-M3)
detection now landing via FastLED#2849 and FastLED#2859, the family-level gate would
silently compile LPC8xx-targeted GPIO controller layouts and M0+ ASM
selection for chips that ship a different GPIO controller (legacy GPIO at
0x50000000 with masked-access semantics on LPC11xx per UM10398 / UM10462;
GPIO per UM11074 on LPC15xx) and a different architecture (M0 not M0+ on
LPC11xx; M3 on LPC15xx).

Surface the gap with a clear `#error` in `fastled_arm_lpc.h` that points
LPC11xx / LPC15xx builds at FastLED#2845 Stage 4 as the tracking issue for the
follow-up driver wiring, and refresh the `is_arm.h` comment block so the
LPC family roll-up reflects what's actually detected today.

No behaviour change for in-tree LPC8xx builds (no platform configuration
currently defines `FL_LPC11` / `FL_LPC15`); this is a latent-bug fix that
keeps the next LPC family scaffolds from accidentally activating LPC8xx
code paths.

Closes FastLED#2865.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@zackees
zackees deleted the feat/lpc15-detection-scaffold branch August 21, 2026 19:15
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