From 810a674c832de5c1604b79a25678311484bb5913 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 8 Feb 2018 13:41:42 +0200 Subject: [PATCH] Force Teensy CLI when Teensy App is not available (Linux ARM) // Resolve #34 --- builder/main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/builder/main.py b/builder/main.py index 8bcdd2a..4a70ea4 100644 --- a/builder/main.py +++ b/builder/main.py @@ -15,7 +15,7 @@ import sys from platform import system from os import makedirs -from os.path import isdir, join +from os.path import isdir, isfile, join from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Builder, Default, DefaultEnvironment) @@ -227,6 +227,14 @@ # Target: Upload by default firmware file # +# Force Teensy CLI when Teensy App is not available (Linux ARM) +if env.subst("$UPLOAD_PROTOCOL") == "teensy-gui" and not isfile( + join( + platform.get_package_dir("tool-teensy") or "", + "teensy_post_compile.exe" + if system() == "Windows" else "teensy_post_compile")): + env.Replace(UPLOAD_PROTOCOL="teensy-cli") + upload_protocol = env.subst("$UPLOAD_PROTOCOL") upload_actions = []