Skip to content

Commit

Permalink
Improved compiler script
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacehuhn committed Jul 15, 2020
1 parent ac7bf78 commit fd8e983
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/arduino-cli-compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@

version = sys.argv[1]

folder = f"build_{version}"
folder = f"../build_{version}"
os.system(f"mkdir {folder}")

for board in boards:
print(f"Compiling {board}...", end="", flush=True)
print(f"Compiling {board}...", flush=True)
os.system(f"arduino-cli cache clean");
command = f"arduino-cli compile --fqbn deauther:esp8266:d1_mini --build-properties \"build.extra_flags=-DESP8266 -D{board}\" --output-dir {folder}"
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
process.wait()
os.system(f"mv {folder}/esp8266_deauther.ino.bin {folder}/esp8266_deauther_{version}_{board}.bin")
print(f"OK")

os.system("rm build/*.elf && rm build/*.map")
os.system(f"rm {folder}/esp8266_deauther.ino.elf")
os.system(f"rm {folder}/esp8266_deauther.ino.map")

print("Finished :)")

0 comments on commit fd8e983

Please sign in to comment.