Skip to content

Commit 856885e

Browse files
committed
Allow overriding SPIFFS image name // Resolve platformio#332
1 parent 6de6681 commit 856885e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

builder/main.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def __fetch_spiffs_size(target, source, env):
160160

161161
MKSPIFFSTOOL="mkspiffs_${PIOPLATFORM}_" + ("espidf" if "espidf" in env.subst(
162162
"$PIOFRAMEWORK") else "${PIOFRAMEWORK}"),
163+
ESP32_SPIFFS_IMAGE_NAME=env.get("ESP32_SPIFFS_IMAGE_NAME", "spiffs"),
164+
163165
PROGSUFFIX=".elf"
164166
)
165167

@@ -212,13 +214,13 @@ def __fetch_spiffs_size(target, source, env):
212214
target_elf = join("$BUILD_DIR", "${PROGNAME}.elf")
213215
if set(["uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
214216
fetch_spiffs_size(env)
215-
target_firm = join("$BUILD_DIR", "spiffs.bin")
217+
target_firm = join("$BUILD_DIR", "${ESP32_SPIFFS_IMAGE_NAME}.bin")
216218
else:
217219
target_firm = join("$BUILD_DIR", "${PROGNAME}.bin")
218220
else:
219221
if set(["buildfs", "uploadfs", "uploadfsota"]) & set(COMMAND_LINE_TARGETS):
220222
target_firm = env.DataToBin(
221-
join("$BUILD_DIR", "spiffs"), "$PROJECTDATA_DIR")
223+
join("$BUILD_DIR", "${ESP32_SPIFFS_IMAGE_NAME}"), "$PROJECTDATA_DIR")
222224
AlwaysBuild(target_firm)
223225
AlwaysBuild(env.Alias("buildfs", target_firm))
224226
else:
@@ -339,15 +341,15 @@ def __fetch_spiffs_size(target, source, env):
339341
"--port", '"$UPLOAD_PORT"',
340342
"--upload",
341343
"0x1000", join(
342-
platform.get_package_dir("framework-arduino-mbcwb"),
344+
platform.get_package_dir("framework-arduino-mbcwb"),
343345
"tools", "sdk", "bin", "bootloader_qio_80m.bin"),
344346
"0x8000", join("$BUILD_DIR", "partitions.bin"),
345347
"0xe000", join(
346-
platform.get_package_dir("framework-arduino-mbcwb"),
348+
platform.get_package_dir("framework-arduino-mbcwb"),
347349
"tools", "partitions", "boot_app0.bin"),
348350
"0x10000", join("$BUILD_DIR", "${PROGNAME}.bin"),
349351
],
350-
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
352+
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS'
351353
)
352354
upload_actions = [
353355
env.VerboseAction(env.AutodetectUploadPort,

0 commit comments

Comments
 (0)