From 99218a5a4cd9a3b684b579ed326e23be2d909f40 Mon Sep 17 00:00:00 2001 From: ranchuan Date: Thu, 17 Oct 2024 16:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=82=E6=95=B0=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E8=BF=90=E8=A1=8C=E4=BC=9A=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kunlun.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kunlun.py b/kunlun.py index a48f465..3b17732 100644 --- a/kunlun.py +++ b/kunlun.py @@ -295,11 +295,15 @@ def global_def(): global time_stamp_end global function_type global upload_key + + arg_num=len(sys.argv) + if(arg_num<=1): + return + init_str="WQKL" serial_com=sys.argv[1] b_rate=115200 nb_rate=1500000 - arg_num=len(sys.argv) def set_upload(): global function_type if(sys.argv[3].endswith('.bin')): @@ -328,17 +332,16 @@ def global_def(): if(function_type=='upload'): ram_file=f'bootram_{sys.argv[2]}.bin' iot_flash_file=sys.argv[3] + ram_file=os.path.join(bin_path(),ram_file) elif(function_type=='download'): ram_file=f'{sys.argv[2]}_ram_build.bin' iot_flash_file=sys.argv[3] + ram_file=os.path.join(bin_path(),ram_file) elif(function_type=='ram'): ram_file=sys.argv[2] iot_flash_file=sys.argv[2] - return elif(function_type=='convert'): iot_flash_file=sys.argv[1] - return - ram_file=os.path.join(bin_path(),ram_file) def print_help():