From 9cc9912ef27e2e1f3eda45697d8e384e4ec5cd60 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 Dec 2015 15:17:38 +0200 Subject: [PATCH] Handle upload_flags option in platformio.ini // Resolve #368 --- HISTORY.rst | 6 ++++++ platformio/__init__.py | 2 +- platformio/builder/main.py | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 9e90581f..ef063bad 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ Release History PlatformIO 2.0 -------------- +2.5.1 (2015-12-??) +~~~~~~~~~~~~~~~~~~ + +* Handle ``upload_flags`` option in `platformio.ini `_ + (`issue #368 `_) + 2.5.0 (2015-12-08) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index 662e56a0..3b5a5dc1 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -VERSION = (2, 5, 0) +VERSION = (2, 5, "1.dev0") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/main.py b/platformio/builder/main.py index dbe503ea..387fed55 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -76,7 +76,8 @@ commonvars.AddVariables( # upload options ("UPLOAD_PORT",), ("UPLOAD_PROTOCOL",), - ("UPLOAD_SPEED",) + ("UPLOAD_SPEED",), + ("UPLOAD_FLAGS",) ) DefaultEnvironment( @@ -161,6 +162,9 @@ env.SConscriptChdir(0) env.SConsignFile(join("$PIOENVS_DIR", ".sconsign.dblite")) env.SConscript("$BUILD_SCRIPT") +if "UPLOAD_FLAGS" in env: + env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"]) + if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")): env.SConscript( environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))