Skip to content

feat(platform/lpc): scope LPC8xx driver code to LPC8xx-only (prep for #2845 Stage 4) #2865

Closed

Description

@zackees

Follow-up to #2849 (LPC11xx Cortex-M0 detection scaffold) and #2859 (LPC15xx Cortex-M3 detection scaffold). Surfaces an issue listed in #2845.

Problem

src/platforms/arm/lpc/fastpin_arm_lpc.h and src/platforms/arm/lpc/clockless_arm_lpc.h currently activate for any FL_IS_ARM_LPC. With #2849 and #2859 having added LPC11xx and LPC15xx detection (both of which set FL_IS_ARM_LPC), the LPC8xx-targeted GPIO controller layout (LPC_GPIO->SET[0]/CLR[0] at base 0xA0000000) and the LPC8xx-targeted clockless driver would silently compile for those families if any platform configuration eventually defines FL_LPC11 or FL_LPC15.

Concretely:

  • LPC11xx (LPC1114, LPC1115, LPC11U24, LPC11U35) is Cortex-M0 (not M0+) with the legacy GPIO controller at 0x50000000 and masked-access semantics (UM10398 §9, UM10462 §9). The LPC8xx FastPin template would compile but write to the wrong addresses.
  • LPC15xx is Cortex-M3 with a different GPIO peripheral layout entirely (UM11074 §11). The M0/M0+ clockless template is the wrong choice on M3.

This is a latent footgun, not currently triggered (no in-tree platform JSON defines FL_LPC11 / FL_LPC15 yet), but the family-level gate is wrong on its face and will trip on the first LPC11xx/15xx port attempt.

Acceptance criteria

  • fastpin_arm_lpc.h: _ARMPIN template guarded by #if defined(FL_LPC845) || defined(FL_LPC804) (LPC8xx-specific), not the family-level FL_IS_ARM_LPC.
  • clockless_arm_lpc.h: ClocklessController template guarded by the same LPC8xx-specific gate; the existing FL_LPC804 + FASTLED_LPC_PLU opt-out remains intact.
  • fastled_arm_lpc.h: emit a clear #error for FL_LPC11 / FL_LPC15 builds that points to this meta (meta: LPC dev roadmap — Stages 3 + 4 (port completion, family expansion) #2845) as the tracking issue for the follow-up driver wiring.
  • is_arm.h: update the LPC family comment block (currently says "NXP LPC8xx (LPC845 / LPC804 Cortex-M0+)") to reflect that LPC8xx, LPC11xx, and LPC15xx are all detected via FL_IS_ARM_LPC, with driver wiring scope documented separately.
  • bash test --cpp passes — no regressions in LPC8xx unit-test surface area (which is the only LPC family with a driver today).

Out of scope (deliberately)

These are tracked in #2845 and remain follow-ups:

  • led_sysdefs_arm_lpc.h updates (FL_IS_ARM_M0 for LPC11xx, FL_IS_ARM_M3 stub for LPC15xx, per-family F_CPU defaults, CMSIS device header includes). Editing led_sysdefs_* files trips the protect_platform_headers.py PreToolUse hook, which requires the maintainer's explicit FL_AGENT_ALLOW_PROTECTED_WRITE=1 env-var override.
  • New fastpin_arm_lpc11.h / clockless_arm_lpc11.h for the LPC11xx legacy GPIO masked-access pattern. Per the meta: LPC dev roadmap — Stages 3 + 4 (port completion, family expansion) #2845 second comment: "patterns are non-trivial to verify without hardware - prefer the maintainer add these once a board is in hand."
  • Analogous LPC15xx M3 driver wiring.

References

Activity

  1. moved this from Triage to Done in FastLED Trackeron Jun 6, 2026
  2. added a commit that references this issue on Jun 6, 2026
    fcc226f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions