From e86adb63c9f5f0e7b3e7104c399297da4ae0e02b Mon Sep 17 00:00:00 2001 From: ranchuan Date: Wed, 19 Feb 2025 19:15:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pg=E7=9A=84rom=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kunlun.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kunlun.py b/kunlun.py index 13ca97d..79e2c15 100644 --- a/kunlun.py +++ b/kunlun.py @@ -29,7 +29,7 @@ def init_send(s_port:serial.Serial, send_str:str): send_str=send_str.encode('utf-8') key_words={ b"WQKL":b"Recieving RAM-IMAGE in xmodem : C", - b"HZPG":b"waiting recieve image: C" + b"HZPG":b"waiting receive image: C" } while True: s_port.write(send_str) @@ -364,19 +364,21 @@ def global_def(): if(args.flash_file is not None): iot_flash_file=args.flash_file log_file=iot_flash_file + if(args.ram_file is not None): + ram_file=ram_file_redirect(args.ram_file) if(os.path.exists(iot_flash_file)): function_type='download' iot_flash_file=bin_file_decrypt(iot_flash_file) if args.kunlun_version is None: args.kunlun_version=check_bin_type(iot_flash_file) - ram_file=f'kl{args.kunlun_version}_ram_build.bin' - ram_file=ram_file_redirect(ram_file) + if ram_file is None: + ram_file=f'kl{args.kunlun_version}_ram_build.bin' + ram_file=ram_file_redirect(ram_file) else: function_type='upload' - ram_file=f'bootram_kl{args.kunlun_version}.bin' - ram_file=ram_file_redirect(ram_file) - if(args.ram_file is not None): - ram_file=ram_file_redirect(args.ram_file) + if ram_file is None: + ram_file=f'bootram_kl{args.kunlun_version}.bin' + ram_file=ram_file_redirect(ram_file) if(args.kunlun_version is None): print("请指定参数 -k") sys.exit(-1)