cmake idf.py: Fix bug in JSON parsing when printing flash commands
This commit is contained in:
parent
7f06543817
commit
408463d0bf
11
tools/idf.py
11
tools/idf.py
|
@ -329,16 +329,17 @@ def print_closing_message(args):
|
||||||
def flasher_path(f):
|
def flasher_path(f):
|
||||||
return os.path.relpath(os.path.join(args.build_dir, f))
|
return os.path.relpath(os.path.join(args.build_dir, f))
|
||||||
|
|
||||||
if key != "project":
|
if key != "project": # flashing a single item
|
||||||
cmd = ""
|
cmd = ""
|
||||||
if key == "bootloader":
|
if key == "bootloader": # bootloader needs --flash-mode, etc to be passed in
|
||||||
cmd = " ".join(flasher_args["write_flash_args"]) + " "
|
cmd = " ".join(flasher_args["write_flash_args"]) + " "
|
||||||
|
|
||||||
cmd += flasher_args[key]["offset"] + " "
|
cmd += flasher_args[key]["offset"] + " "
|
||||||
cmd += flasher_path(flasher_args[key]["file"])
|
cmd += flasher_path(flasher_args[key]["file"])
|
||||||
else:
|
else: # flashing the whole project
|
||||||
cmd = " ".join(flasher_args["write_flash_args"]) + " "
|
cmd = " ".join(flasher_args["write_flash_args"]) + " "
|
||||||
for o,f in flasher_args["flash_files"].items():
|
flash_items = sorted((o,f) for (o,f) in flasher_args["flash_files"].items() if len(o) > 0)
|
||||||
|
for o,f in flash_items:
|
||||||
cmd += o + " " + flasher_path(f) + " "
|
cmd += o + " " + flasher_path(f) + " "
|
||||||
|
|
||||||
print("%s -p %s -b %s write_flash %s" % (
|
print("%s -p %s -b %s write_flash %s" % (
|
||||||
|
@ -346,7 +347,7 @@ def print_closing_message(args):
|
||||||
args.port or "(PORT)",
|
args.port or "(PORT)",
|
||||||
args.baud,
|
args.baud,
|
||||||
cmd.strip()))
|
cmd.strip()))
|
||||||
print("or run 'idf.py -p PORT %s'" % (key + "-flash" if key != "project" else "flash",))
|
print("or run 'idf.py -p %s %s'" % (args.port or "(PORT)", key + "-flash" if key != "project" else "flash",))
|
||||||
|
|
||||||
if "all" in args.actions or "build" in args.actions:
|
if "all" in args.actions or "build" in args.actions:
|
||||||
print_flashing_message("Project", "project")
|
print_flashing_message("Project", "project")
|
||||||
|
|
Loading…
Reference in a new issue