Skip to content

Commit

Permalink
check for platform and not file extension for creating uf2 file
Browse files Browse the repository at this point in the history
  • Loading branch information
elral committed Aug 30, 2024
1 parent cdace81 commit c91b68a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion copy_fw_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# Get the foldername inside the zip file from the build environment.
community_folder = env.GetProjectOption('custom_community_folder', "")

platform = env.BoardConfig().get("platform", {})

def copy_fw_files (source, target, env):
fw_file_name=str(target[0])
Expand All @@ -27,7 +28,7 @@ def copy_fw_files (source, target, env):
shutil.copytree(custom_source_folder + "/Community", "./_build/" + custom_source_folder + "/Community", dirs_exist_ok=True)
print("Creating /_build folder")

if fw_file_name[-3:] == "bin":
if platform == "raspberrypi":
fw_file_name=fw_file_name[0:-3] + "uf2"

print("Copying community folder")
Expand Down

0 comments on commit c91b68a

Please sign in to comment.