From 6e13308e25b60807b8a4aed3446b1d3714121450 Mon Sep 17 00:00:00 2001 From: KerJoe <40915672+KerJoe@users.noreply.github.com> Date: Mon, 19 Dec 2022 21:09:06 +0400 Subject: [PATCH] Correct -z flag wrong variable, ignore errors on controller reset --- rtdmultiprog.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rtdmultiprog.py b/rtdmultiprog.py index b899fc7..66dee64 100644 --- a/rtdmultiprog.py +++ b/rtdmultiprog.py @@ -84,8 +84,11 @@ def enter_isp(): def reboot_controller(): """ Disable In-System Programming mode, Restart internal MCU """ - write_reg(0xEE, 0x02) - write_reg(0x6F, 0x01) + try: + write_reg(0xEE, 0x02) + #write_reg(0x6F, 0x00) + except ConnectionError: + pass def isp_custom_instruction(cmd_type, cmd_code, read_n, write_n, write_value): if write_n == 1: @@ -347,7 +350,7 @@ def interface_get_help(): if args.read_file: if args.read_size: - READ_SIZE = int(args.readSize, 0) + READ_SIZE = int(args.read_size, 0) else: print(f"WARNING: '-z READ_SIZE' not set, default read amount of {READ_SIZE // 1024} KiB used") if not read_flash_file(args.read_file, lambda s, e, c: progress_bar(c/(e-s))):