Skip to content

Commit da46318

Browse files
authored
final safeboot changes
1 parent 7ea7e3f commit da46318

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tools/platformio-build.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ def add_tinyuf2_extra_image():
179179
libs = []
180180

181181
variants_dir = join(FRAMEWORK_DIR, "variants")
182-
build_name = join(board_config.get("name"))
182+
build_variants_dir = join(board_config.get("build.variants_dir"))
183183

184184
if "build.variants_dir" in board_config:
185-
if "Tasmota" not in build_name:
185+
if len(build_variants_dir) > 1:
186186
variants_dir = join("$PROJECT_DIR", board_config.get("build.variants_dir"))
187187

188188
if "build.variant" in board_config:
@@ -206,11 +206,14 @@ def add_tinyuf2_extra_image():
206206
# Process framework extra images
207207
#
208208

209-
# Tasmota places extra images "safeboot" in custom variants folder in project directory
210-
if "Tasmota" in build_name:
211-
EXTRA_IMG_DIR = join(variants_dir, "tasmota")
209+
# Tasmota places extra images "safeboot" in custom variants folder in Project or Framework directory
210+
build_name = join(board_config.get("name"))
211+
if len(build_variants_dir) > 1:
212+
EXTRA_IMG_DIR = join(variants_dir)
212213
else:
213214
EXTRA_IMG_DIR = FRAMEWORK_DIR
215+
if "tasmota" in build_name.lower():
216+
EXTRA_IMG_DIR = join(EXTRA_IMG_DIR, "variants", "tasmota")
214217

215218
env.Append(
216219
LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")],

0 commit comments

Comments
 (0)