From 80d6120246d6859c6657bdd5ef05eb9c15c131ce Mon Sep 17 00:00:00 2001 From: ranchuan Date: Fri, 14 Feb 2025 18:15:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=8B=E8=BD=BDpangu?= =?UTF-8?q?=E7=9A=84ram.bin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kunlun.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kunlun.py b/kunlun.py index 735c3ea..fb85071 100644 --- a/kunlun.py +++ b/kunlun.py @@ -27,6 +27,10 @@ from bin.factory_mode import ftm_handle def init_send(s_port:serial.Serial, send_str:str): s_info = bytearray() 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" + } while True: s_port.write(send_str) time.sleep(0.1) @@ -34,7 +38,7 @@ def init_send(s_port:serial.Serial, send_str:str): bytes2read = s_port.in_waiting tmp = s_port.read(bytes2read) s_info += tmp - if(s_info.find(b"Recieving RAM-IMAGE in xmodem : C")>=0): + if(s_info.find(key_words[send_str])>=0): m_ram=True else: m_ram=False @@ -375,6 +379,8 @@ def global_def(): if(args.kunlun_version is None): print("请指定参数 -k") sys.exit(-1) + elif(args.kunlun_version == "4"): + init_str="HZPG" if(args.upload_key is not None): upload_key = args.upload_key else: