Closed Timvrakas closed 4 years ago
This appears to be what I've been looking for. Do you have an example project configured to use this?
Yes, see https://github.com/stanford-ssi/olympus-quail The relevant aspects boil down to:
variant
folder in project directory, which is a copy of feather_m0
, with board-specific changesscript.py
which is a hacky way of interfacing with the build scripts. (suggestions welcome)platformio.ini
which points to the branch of this PR, and attaches script.py
let me know if you have any questions, Tim
That is very helpful. Thank you!
How about if we add support for board_build.variants_dir
? Then you can create in your project custom_variants
and later use in platformio.ini
:
[env:myenv]
board_build.variant = feather0custom
board_build.variants_dir = custom_variants
It will automatically find custom_variants
in a project root. A relative path is OK.
That sounds good to me. I'll take a look at implementing it.
Hi @Timvrakas ! I've added the feature with custom variants. Could you please retest with the latest atmelsam platform? (Also, keep in mind that the upload process for adafruit boards (based on samd21) has been modified in the dev branch).
[env:adafruit_feather_m0]
platform = https://github.com/platformio/platform-atmelsam.git
board = adafruit_feather_m0
framework = arduino
board_build.variant = feather0custom
board_build.variants_dir = custom_variants
Thanks!
Awesome, it looks like it works! For anyone interested, my project now looks like this: https://github.com/stanford-ssi/olympus-quail/commit/eebde2d8b049af9956f5535ddcebfebb1631b643
Thanks a lot for the help folks!
This is what I've been using to load portable variants files. You maintain a folder
variant
in the project directory, and setenv.Append(OVERRIDE_VARIANT=True)
in a script, which activates this code. I'm not sure how to implement this as an option inplatformio.ini
, which would be more intuitive. Open for feedback!Tim