Skip to content

Commit 682a46d

Browse files
committed
Fix load flashtool based on system type
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 5895e40 commit 682a46d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builder/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
env = DefaultEnvironment()
1616
platform = env.PioPlatform()
1717
board = env.BoardConfig()
18+
flasher_path = platform.get_package_dir("tool-siwiflasher") or ""
1819

1920
env.Replace(
2021
AR="arm-none-eabi-ar",
@@ -39,7 +40,7 @@
3940
# Setup tools based on system type
4041
if "windows" in get_systype():
4142
env.Replace(
42-
SIWIFLASHER=join(platform.get_package_dir("tool-siwiflasher") or "", "siwiflasher"),
43+
SIWIFLASHER=join(flasher_path, "siwiflasher"),
4344
REFLASH_FLAGS=[
4445
"-r",
4546
"-b", "$UPLOAD_SPEED",
@@ -49,9 +50,8 @@
4950
)
5051
else:
5152
env.Replace(
52-
SIWIFLASHER='"$PYTHONEXE"' + join(platform.get_package_dir(
53-
"tool-pysiwiflasher") or "", "siwiflasher.py"),
54-
REFLASH_CMD="echo Sorry! Reflashing is only supported on windows!"
53+
SIWIFLASHER='"$PYTHONEXE" ' + join(flasher_path, "siwiflasher.py"),
54+
REFLASH_CMD='echo "Sorry! Reflashing is only supported on windows! :("'
5555
)
5656

5757
# Allow user to override via pre:script

0 commit comments

Comments
 (0)