Skip to content

Commit

Permalink
Update action_compile_all.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DeqingSun committed Nov 1, 2024
1 parent 2282bb2 commit 187fea5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/action_compile_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 187fea5

Please sign in to comment.