Repository navigation
feat(platform): LPC11xx (Cortex-M0) family detection scaffold (#2845) - #2849
Conversation
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]>
|
Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place. Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis 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. ChangesLPC11xx Platform Detection Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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]>
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]>
Summary
Stage 4 scaffold from #2845. Adds NXP LPC11xx family detection to
src/platforms/arm/lpc/is_lpc.h:FL_LPC11macro keyed on__LPC11xx__,LPC11xx, and CMSIS-styleCPU_LPC1114*/CPU_LPC1115*/CPU_LPC11U24*/CPU_LPC11U35*identifiers.FL_IS_ARM_LPCroll-up extended to includeFL_LPC11so the existingis_arm.hdispatch picks up LPC11xx as an ARM platform automatically.Critical architectural note (also in code comments)
LPC11xx is Cortex-M0, NOT M0+. The
is_lpc.hheader deliberately does NOT setFL_IS_ARM_M0_PLUSforFL_LPC11— the led_sysdefs follow-up will introduceFL_IS_ARM_M0instead. 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: gateFL_IS_ARM_M0_PLUSonFL_LPC845/FL_LPC804only; introduceFL_IS_ARM_M0forFL_LPC11; pickF_CPU = 48000000ULfor LPC11xx (12 MHz xtal × 4 PLL); includeLPC11xx.hvia__has_includefallback 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 separateclockless_arm_lpc11.hthat wraps the shared M0 ASM template (src/platforms/arm/common/m0clockless_asm.h, also used by nRF51).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_LPC804detection 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
Refs #2845, #2836
🤖 Generated with Claude Code
Summary by CodeRabbit