-
Notifications
You must be signed in to change notification settings - Fork 1
/
upload_script.py
32 lines (26 loc) · 1.11 KB
/
upload_script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
################################################################################################
#
# This script is currently not used, but kept here as an example for options to influence upload
#
# all env-vairables are available with pio run --target envdump
#
################################################################################################
Import("env")
# please keep $SOURCE variable, it will be replaced with a path to firmware
# # Generic
# env.Replace(
# UPLOADER="C:\\Users\\d019748\\.platformio\\packages\\tool-bossac\\bossac.exe",
# UPLOADCMD="$UPLOADER $UPLOADERFLAGS -w $SOURCE"
# )
# # In-line command with arguments
# env.Replace(
# UPLOADCMD="C:\\Users\\d019748\\.platformio\\packages\\tool-bossac\\bossac.exe -v -R -w $SOURCE"
# )
# Python callback
def on_upload(source, target, env):
firmware_path = str(source[0])
print("firmware_path {0}".format(firmware_path))
print("UPLOADCMD: {0}, UPLOADPORT: {1}".format(env.Dump("UPLOADCMD"), "leer")) # env.Dump("UPLOADPORT")))
# do something
# env.Execute("executable arg1 arg2")
env.Replace(UPLOADCMD=on_upload)