I have set environment variables within python scripts so that I can use them in my source files. I know how to use a common section and refer to those settings in board-specific settings. What I am looking for is how I might set a
platformio.ini value via the environment set by the python script.
Specifically, I have tried this:
build_flagsspecify a python file with
!python script.pywhich sets an environment variable with
platformio.ini, “read” that value when setting
monitor_portwith something like
upload_port = -DPORT
The end goal here is not having to edit the
platformio.ini port values as we switch between a Mac and a Windows user. It seems to work fine with auto settings on Windows machines, but apparently, the developer on the Mac has to be more explicit.