Make generating combined binary output verbose (#3127)

This commit is contained in:
Otto Winter 2022-02-11 09:06:00 +01:00 committed by Jesse Hills
parent f376a39e55
commit dd554bcdf4
No known key found for this signature in database
GPG key ID: BEAAE804EFD8E83A

View file

@ -1,12 +1,15 @@
# Source https://github.com/letscontrolit/ESPEasy/pull/3845#issuecomment-1005864664 # Source https://github.com/letscontrolit/ESPEasy/pull/3845#issuecomment-1005864664
import esptool import esptool
from SCons.Script import ARGUMENTS
# pylint: disable=E0602 # pylint: disable=E0602
Import("env") # noqa Import("env") # noqa
def esp32_create_combined_bin(source, target, env): def esp32_create_combined_bin(source, target, env):
verbose = bool(int(ARGUMENTS.get("PIOVERBOSE", "0")))
if verbose:
print("Generating combined binary for serial flashing") print("Generating combined binary for serial flashing")
app_offset = 0x10000 app_offset = 0x10000
@ -24,15 +27,18 @@ def esp32_create_combined_bin(source, target, env):
"--flash_size", "--flash_size",
flash_size, flash_size,
] ]
if verbose:
print(" Offset | File") print(" Offset | File")
for section in sections: for section in sections:
sect_adr, sect_file = section.split(" ", 1) sect_adr, sect_file = section.split(" ", 1)
if verbose:
print(f" - {sect_adr} | {sect_file}") print(f" - {sect_adr} | {sect_file}")
cmd += [sect_adr, sect_file] cmd += [sect_adr, sect_file]
print(f" - {hex(app_offset)} | {firmware_name}")
cmd += [hex(app_offset), firmware_name] cmd += [hex(app_offset), firmware_name]
if verbose:
print(f" - {hex(app_offset)} | {firmware_name}")
print() print()
print(f"Using esptool.py arguments: {' '.join(cmd)}") print(f"Using esptool.py arguments: {' '.join(cmd)}")
print() print()