Skip to content

Commit 9f345e3

Browse files
committed
Allow to override PROGNAME // Resolve platformio#54
1 parent f067844 commit 9f345e3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

builder/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ def _get_board_f_flash(env):
143143
MKSPIFFSTOOL="mkspiffs",
144144
SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES',
145145

146-
PROGNAME="firmware",
147146
PROGSUFFIX=".elf"
148147
)
149148

@@ -153,6 +152,8 @@ def _get_board_f_flash(env):
153152

154153
if int(ARGUMENTS.get("PIOVERBOSE", 0)):
155154
env.Prepend(UPLOADERFLAGS=["-vv"])
155+
if env.get("PROGNAME", "program") == "program":
156+
env.Replace(PROGNAME="firmware")
156157

157158
#
158159
# Keep support for old LD Scripts
@@ -353,7 +354,7 @@ def __fetch_spiffs_size(target, source, env):
353354
fetch_spiffs_size(env)
354355
target_firm = join("$BUILD_DIR", "spiffs.bin")
355356
elif env.subst("$PIOFRAMEWORK") in ("arduino", "simba"):
356-
target_firm = join("$BUILD_DIR", "firmware.bin")
357+
target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
357358
else:
358359
target_firm = [
359360
join("$BUILD_DIR", "eagle.flash.bin"),
@@ -368,7 +369,7 @@ def __fetch_spiffs_size(target, source, env):
368369
else:
369370
if env.subst("$PIOFRAMEWORK") in ("arduino", "simba"):
370371
target_firm = env.ElfToBin(
371-
join("$BUILD_DIR", "firmware"), target_elf)
372+
join("$BUILD_DIR", "${PROGNAME}"), target_elf)
372373
else:
373374
target_firm = env.ElfToBin([
374375
join("$BUILD_DIR", "eagle.flash.bin"),

0 commit comments

Comments
 (0)