1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-16 07:40:29 +01:00

add support for merged image

This commit is contained in:
Tomasz Duda 2025-01-25 22:26:36 +01:00
parent c1be5c4680
commit 3334ce5058

View File

@ -118,6 +118,7 @@ def get_download_types(storage_json):
UF2_PATH = "zephyr/zephyr.uf2" UF2_PATH = "zephyr/zephyr.uf2"
DFU_PATH = "firmware.zip" DFU_PATH = "firmware.zip"
HEX_PATH = "zephyr/zephyr.hex" HEX_PATH = "zephyr/zephyr.hex"
HEX_MERGED_PATH = "zephyr/merged.hex"
build_dir = Path(storage_json.firmware_bin_path).parent build_dir = Path(storage_json.firmware_bin_path).parent
if (build_dir / UF2_PATH).is_file(): if (build_dir / UF2_PATH).is_file():
types = [ types = [
@ -139,7 +140,9 @@ def get_download_types(storage_json):
{ {
"title": "HEX package", "title": "HEX package",
"description": "For flashing via pyocd using SWD.", "description": "For flashing via pyocd using SWD.",
"file": HEX_PATH, "file": HEX_MERGED_PATH
if (build_dir / HEX_MERGED_PATH).is_file()
else HEX_PATH,
"download": f"{storage_json.name}.hex", "download": f"{storage_json.name}.hex",
}, },
] ]