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)