From 187fea54e62174a5920aed0f8a09b9413dc12f79 Mon Sep 17 00:00:00 2001 From: Deqing Sun Date: Fri, 1 Nov 2024 16:32:43 -0400 Subject: [PATCH] Update action_compile_all.py --- util/action_compile_all.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/action_compile_all.py b/util/action_compile_all.py index a7ddcdf6..fbbea134 100644 --- a/util/action_compile_all.py +++ b/util/action_compile_all.py @@ -13,6 +13,11 @@ print(f"example search directory not found at {example_folder}") exit(1) +arduino_package_path = "" +if len(sys.argv) >= 2: + #the second argument is the path to the arduino package + arduino_package_path = "--config-dir " + sys.argv[2] + compiled_hex_folder = os.path.join(example_folder, "compiled_hex") if not os.path.isdir(compiled_hex_folder): os.makedirs(compiled_hex_folder) @@ -43,7 +48,7 @@ board_options_string = '--board-options '+row.replace('cli board options:', '').strip() break - build_cmd = f"arduino-cli compile --fqbn CH55xDuino:mcs51:ch552 --output-dir {compiled_hex_folder} {example_directory}" + build_cmd = f"arduino-cli compile {arduino_package_path} --fqbn CH55xDuino:mcs51:ch552 --output-dir {compiled_hex_folder} {example_directory}" if board_options_string != "": build_cmd = build_cmd + " " + board_options_string example_name = os.path.basename(example_directory)