Skip to content

feat(platform): LPC11xx (Cortex-M0) family detection scaffold (#2845) - #2849

Merged
zackees merged 1 commit into
masterfrom
feat/2845-lpc11xx-scaffold
Jun 6, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/2845-lpc11xx-scaffold

Conversation

@zackees

@zackees zackees commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Stage 4 scaffold from #2845. Adds NXP LPC11xx family detection to src/platforms/arm/lpc/is_lpc.h:

  • New FL_LPC11 macro keyed on __LPC11xx__, LPC11xx, and CMSIS-style CPU_LPC1114* / CPU_LPC1115* / CPU_LPC11U24* / CPU_LPC11U35* identifiers.
  • FL_IS_ARM_LPC roll-up extended to include FL_LPC11 so the existing is_arm.h dispatch picks up LPC11xx as an ARM platform automatically.

Critical architectural note (also in code comments)

LPC11xx is Cortex-M0, NOT M0+. The is_lpc.h header deliberately does NOT set FL_IS_ARM_M0_PLUS for FL_LPC11 — the led_sysdefs follow-up will introduce FL_IS_ARM_M0 instead. Mis-defining M0+ on an M0 part causes silent encoding errors in the shared inline-assembly clockless driver (load/store immediate-offset width differs between M0 and M0+).

Follow-up work (deferred — touches a protected header)

  • led_sysdefs_arm_lpc.h: gate FL_IS_ARM_M0_PLUS on FL_LPC845 / FL_LPC804 only; introduce FL_IS_ARM_M0 for FL_LPC11; pick F_CPU = 48000000UL for LPC11xx (12 MHz xtal × 4 PLL); include LPC11xx.h via __has_include fallback chain.
  • fastpin_arm_lpc.h / clockless_arm_lpc.h: LPC11xx GPIO register layout differs from LPC8xx (uses MASKED_ACCESS instead of SET/CLR at +0x2200/+0x2280). Needs a separate clockless_arm_lpc11.h that wraps the shared M0 ASM template (src/platforms/arm/common/m0clockless_asm.h, also used by nRF51).
  • fbuild board definitions for LPC11xx (separate fbuild PR).

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

Companion PR

FastLED/fbuild#420 ships the Stage 3 fbuild-side work for LPC8xx (real SystemInit + expanded vector tables + per-chip mcu_config split).

Test plan

  • Header-only change — does not affect any currently-supported build
  • Verify compile on a real LPC11xx target once the driver follow-up lands (hardware-gated)

Refs #2845, #2836

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added detection support for LPC11xx ARM microcontrollers
  • Improvements
    • Expanded LPC microcontroller family detection coverage to include additional device variants

Stage 4 scaffold from #2845. Adds NXP LPC11xx family
detection to is_lpc.h:

  - New FL_LPC11 macro keyed on __LPC11xx__, LPC11xx, and CMSIS-style
    CPU_LPC1114*/CPU_LPC1115*/CPU_LPC11U24*/CPU_LPC11U35* identifiers.
  - FL_IS_ARM_LPC roll-up extended to include FL_LPC11 so the existing
    is_arm.h dispatch picks up LPC11xx as an ARM platform automatically.

Critical architectural note (also in code comments):
  LPC11xx is Cortex-M0, NOT M0+. The is_lpc.h header deliberately does
  NOT set FL_IS_ARM_M0_PLUS for FL_LPC11 — the led_sysdefs follow-up
  will introduce FL_IS_ARM_M0 instead. Mis-defining M0+ on an M0 part
  causes silent encoding errors in the shared inline-assembly clockless
  driver (load/store immediate-offset width differs).

Follow-up work (deferred — touches a protected header):
  - led_sysdefs_arm_lpc.h: gate FL_IS_ARM_M0_PLUS on FL_LPC845/FL_LPC804
    only; introduce FL_IS_ARM_M0 for FL_LPC11; pick F_CPU = 48000000UL
    for LPC11xx; include LPC11xx.h via __has_include fallback chain.
  - fastpin_arm_lpc.h / clockless_arm_lpc.h: LPC11xx GPIO register layout
    differs from LPC8xx; will need a separate clockless_arm_lpc11.h
    using the shared M0 ASM template.
  - fbuild board definitions for LPC11xx (separate fbuild PR).

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

Refs #2845, #2836

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

coderabbitai Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place.

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR extends ARM LPC platform detection in FastLED to recognize LPC11xx devices. It updates the detection header documentation to describe multi-family LPC coverage, adds explicit LPC11xx detection logic with part-number macro checks, and integrates LPC11xx into the general LPC family detection condition.

Changes

LPC11xx Platform Detection Support

Layer / File(s) Summary
LPC11xx detection and family integration
src/platforms/arm/lpc/is_lpc.h
Header documentation expanded to describe LPC family detection across LPC8xx and LPC11xx variants. New FL_LPC11 macro detects LPC11xx devices via __LPC11xx__, LPC11xx, and CPU_LPC11* defines. LPC11xx is clarified as Cortex-M0 (not M0+) and must not be treated as FL_IS_ARM_M0_PLUS. General LPC roll-up condition updated to include FL_LPC11 alongside existing LPC8xx checks so FL_IS_ARM_LPC is enabled for LPC11xx.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through LPC lanes,
Adding M0 chips to the plains,
LPC11 now detects with glee,
The family grows, one, two, three! ✨

🚥 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 'LPC11xx (Cortex-M0) family detection scaffold' directly and accurately describes the main change: adding detection support for the LPC11xx family of ARM microcontrollers.
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/2845-lpc11xx-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.

@fastled-project-sync fastled-project-sync Bot moved this to In Progress in FastLED Tracker Jun 6, 2026
@zackees
zackees marked this pull request as ready for review June 6, 2026 00:23
@fastled-project-sync fastled-project-sync Bot moved this from In Progress to Triage in FastLED Tracker Jun 6, 2026
@zackees
zackees merged commit f10cc36 into master Jun 6, 2026
7 checks passed
@zackees
zackees deleted the feat/2845-lpc11xx-scaffold branch June 6, 2026 00:24
@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
Stage 4 item 2 from FastLED#2845. Adds NXP LPC15xx family
detection to is_lpc.h, mirroring the LPC11xx scaffold (FastLED#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 FastLED#2845, FastLED#2836, FastLED#2831

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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]>
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