platformio/builder-framework-arduino-nrf5

Support build.variants_dir

maxgerhardt opened this issue · 0 comments

Per https://community.platformio.org/t/custom-nrf52832-board-pinout/24491/7?u=maxgerhardt.

The Atmel-SAM and also ST-STM32 Arduino builder scripts allow the user to manually re-point the used Arduino core's variant directory into a different folder, which is usefull for implementing custom Arduino variants / board support.

This is e.g. done in

https://github.com/platformio/platform-atmelsam/blob/develop/builder/frameworks/arduino/arduino-sam.py#L75-L93

However, all Nordic NRF52 Arduino builder scripts don't support this feature, compare this to

if "build.variant" in board:
env.Append(CPPPATH=[
join(FRAMEWORK_DIR, "variants", board.get("build.variant"))
])
libs.append(
env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(FRAMEWORK_DIR, "variants",
board.get("build.variant"))))

where a constant join(FRAMEWORK_DIR, "variants", board.get("build.variant") is used.

The two arduino builder scripts here should be expanded to allow that feature.