I’ve been working on adding an STM32L0 arduino core from https://github.com/GrumpyOldPizza/ArduinoCore-stm32l0 to platformio. I have it working but am wondering what the best way to integrate is. It lives in a separate
framework-arduinostm32l0 package but I need to insert it somehow into the
ststm32 platform. What I did was to add to
platform.json, add a build script into
builder/frameworks/arduino and then extend the hokey matching at the end of
from SCons.Script import DefaultEnvironment env = DefaultEnvironment() if "stm32f1" in env.BoardConfig().get("build.variant"): env.SConscript('maple/stm32f1.py', exports="env") if "stm32l0" in env.BoardConfig().get("build.mcu"): env.SConscript('stm32l0/stm32l0.py', exports="env")
Notice the last two lines, which I added.
- is there no cleaner way to do this?
- how do I do this in my environment such that it doesn’t get wiped the next time I upgrade platformio?