From 7bd303dd06b188dee4f6a7ddb6c3c1689f52229b Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 6 Jan 2024 21:02:27 -0600 Subject: [PATCH] optionally concatenate files in .uf2 format --- gp2040ce_bintools/builder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gp2040ce_bintools/builder.py b/gp2040ce_bintools/builder.py index c938ce0..a1b7656 100644 --- a/gp2040ce_bintools/builder.py +++ b/gp2040ce_bintools/builder.py @@ -106,7 +106,10 @@ def concatenate_firmware_and_storage_files(firmware_filename: str, if combined_filename: with open(combined_filename, 'wb') as combined: - combined.write(new_binary) + if combined_filename[-4:] == '.uf2': + combined.write(convert_binary_to_uf2(new_binary)) + else: + combined.write(new_binary) if usb: endpoint_out, endpoint_in = get_bootsel_endpoints() write(endpoint_out, endpoint_in, GP2040CE_START_ADDRESS, bytes(new_binary))