Unverified Commit c6a63241 authored by Max Scheffler's avatar Max Scheffler Committed by GitHub

Expand path to tinuf2 image when checking existence in platformio-build.py (#7631)

* Expand path to tinuf2 image when checking existence

* More isFiles fixed
parent 37c81dc2
...@@ -51,19 +51,19 @@ def get_partition_table_csv(variants_dir): ...@@ -51,19 +51,19 @@ def get_partition_table_csv(variants_dir):
if partitions_name: if partitions_name:
# A custom partitions file is selected # A custom partitions file is selected
if isfile(join(variant_partitions_dir, partitions_name)): if isfile(env.subst(join(variant_partitions_dir, partitions_name))):
return join(variant_partitions_dir, partitions_name) return join(variant_partitions_dir, partitions_name)
return abspath( return abspath(
join(fwpartitions_dir, partitions_name) join(fwpartitions_dir, partitions_name)
if isfile(join(fwpartitions_dir, partitions_name)) if isfile(env.subst(join(fwpartitions_dir, partitions_name)))
else partitions_name else partitions_name
) )
variant_partitions = join(variant_partitions_dir, "partitions.csv") variant_partitions = join(variant_partitions_dir, "partitions.csv")
return ( return (
variant_partitions variant_partitions
if isfile(variant_partitions) if isfile(env.subst(variant_partitions))
else join(fwpartitions_dir, "default.csv") else join(fwpartitions_dir, "default.csv")
) )
...@@ -81,7 +81,7 @@ def get_bootloader_image(variants_dir): ...@@ -81,7 +81,7 @@ def get_bootloader_image(variants_dir):
return ( return (
variant_bootloader variant_bootloader
if isfile(variant_bootloader) if isfile(env.subst(variant_bootloader))
else generate_bootloader_image( else generate_bootloader_image(
join( join(
FRAMEWORK_DIR, FRAMEWORK_DIR,
...@@ -126,8 +126,8 @@ def add_tinyuf2_extra_image(): ...@@ -126,8 +126,8 @@ def add_tinyuf2_extra_image():
) )
# Add the UF2 image only if it exists and it's not already added # Add the UF2 image only if it exists and it's not already added
if not isfile(tinuf2_image): if not isfile(env.subst(tinuf2_image)):
print("Warning! The `%s` UF2 bootloader image doesn't exist" % tinuf2_image) print("Warning! The `%s` UF2 bootloader image doesn't exist" % env.subst(tinuf2_image))
return return
if any( if any(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment