Improve checking for the program size before uploading // Issue #689

This commit is contained in:
Ivan Kravets
2016-06-11 15:39:06 +03:00
parent a4345cedc5
commit 5398dbef95
12 changed files with 36 additions and 61 deletions
+3 -4
View File
@@ -25,8 +25,6 @@ from platformio.util import get_serialports
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
env.AutodetectUploadPort()
board_type = env.subst("$BOARD")
if "zero" not in board_type:
env.Append(
@@ -177,8 +175,9 @@ if env.subst("$BOARD") == "zero":
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[env.CheckUploadSize, "$UPLOADCMD"])
else:
upload = env.Alias(["upload", "uploadlazy"], target_firm,
[env.CheckUploadSize, BeforeUpload, "$UPLOADCMD"])
upload = env.Alias(
["upload", "uploadlazy"], target_firm,
[env.AutodetectUploadPort, BeforeUpload, "$UPLOADCMD"])
AlwaysBuild(upload)