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():