feat(nxplpc): pick up project-local variants/<variant>/pins_arduino.h#521
Conversation
Stage-3 hookup, partial (#479). When the project ships an Arduino-style hardware-package layout next to its `platformio.ini` (e.g. zackees/ArduinoCore-LPC8xx, with `<project>/variants/<variant>/pins_arduino.h` + `variant.h`), prepend the variant dir (and its parent `variants/`) to the nxplpc orchestrator's include path. The bundled `Arduino.h` stub now ends its preamble with #if defined(__has_include) # if __has_include("pins_arduino.h") # include "pins_arduino.h" # endif #endif so when the variant dir is on the include path, the variant's `pins_arduino.h` -> `variant.h` chain provides `LED_BUILTIN`, `PIN_SPI_*`, etc. Without a project-local variant, nothing changes — the `__has_include` guard makes the include a no-op and the bundled stub's behavior is preserved for the existing fixture-only tests. ## Verified locally Before this patch, against zackees/ArduinoCore-LPC8xx examples/Blink: Blink.ino:5:13: error: 'LED_BUILTIN' was not declared in this scope After: Board: NXP LPC845-BRK / LPC845 @ 30MHz Memory: 64.00KB Flash, 16.00KB RAM Toolchain: arm-none-eabi-gcc 15.2.1 Compiled 6/6 files Compiled 1/1 files Linking firmware.elf Building firmware.bin Flash: 384 bytes / 64.00KB (0.6%) RAM: 8 bytes / 16.00KB (0.0%) build succeeded in 1.8s (flash: 384 bytes, ram: 8 bytes) ## Tests cargo test -p fbuild-build nxplpc --lib: 18 pass, 0 fail. ## What this does NOT do This is the cheapest user-unblock — it gives the bundled-stub Arduino core access to the project's variant header. It does NOT yet: - Compile user-provided `cores/<core>/` sources (the bundled `arduino_stub` + `lpc8xx_main.cpp` shim still owns the runtime). - Honor `board_build.ldscript` overrides; the bundled per-MCU linker script still wins. - Resolve `framework-arduino-lpc8xx` via PlatformIO's package manager a la `platform_packages = ...` in `platformio.ini`. Full Stage 3 (#479) covers those. The remaining bits are mostly orchestrator-side wiring; this PR is the minimum to flip zackees/ArduinoCore-LPC8xx's fbuild CI green.
|
Warning Review limit reached
More reviews will be available in 53 minutes and 12 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Ships #521: nxplpc orchestrator picks up project-local variants/<variant>/pins_arduino.h so projects with Arduino-style hardware-package layouts (e.g. zackees/ArduinoCore-LPC8xx) build green under fbuild.
Minimum cheap step toward #479 (Stage 3) — gets a real Arduino-style hardware-package project building under fbuild without a full external-framework checkout flow.
What
When the project ships
<project>/variants/<variant>/pins_arduino.hnext to itsplatformio.ini(e.g. zackees/ArduinoCore-LPC8xx), the nxplpc orchestrator prepends the variant dir to the include path. The bundledArduino.hstub gains a__has_includeguard that pulls inpins_arduino.hwhen it's available, transparently surfacingLED_BUILTIN,PIN_SPI_*, etc. Without a project-local variant the include is a no-op — bundled stub behavior is preserved for the existing test fixtures.Verified locally
Against
zackees/ArduinoCore-LPC8xx examples/Blink:Before:
After (real artifact emitted):
firmware.binandfirmware.elfproduced at the expected path.Tests
What this does NOT do
Intentionally scoped to the cheapest user-unblock:
cores/<core>/sources — the bundledarduino_stub/+lpc8xx_main.cppshim still owns the runtime.board_build.ldscript; bundled per-MCU linker script still wins.framework-arduino-lpc8xxvia PlatformIO's package manager.Those are the remaining Stage 3 pieces (#479). Filed separately if anyone wants to take them.
Why this scoping
zackees/ArduinoCore-LPC8xx's fbuild CI is currently red exclusively onLED_BUILTIN. Adding the variant dir to the include path is the surgical fix; full external-framework ingestion is a larger lift that can land independently. Doing the smaller change first means we ship green CI now and can take the bigger refactor when there's time.