2023-05-15 06:08:25 -03:00
|
|
|
#!/usr/bin/env python3
|
2018-10-29 22:54:48 -03:00
|
|
|
|
|
|
|
"""
|
|
|
|
script to build iofirmware and copy to Tools/IO_Firmware
|
2021-06-21 23:05:04 -03:00
|
|
|
|
|
|
|
AP_FLAKE8_CLEAN
|
2018-10-29 22:54:48 -03:00
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
os.environ['PYTHONUNBUFFERED'] = '1'
|
|
|
|
|
2021-06-21 23:05:04 -03:00
|
|
|
|
2018-10-29 22:54:48 -03:00
|
|
|
def run_program(cmd_list):
|
|
|
|
print("Running (%s)" % " ".join(cmd_list))
|
|
|
|
retcode = subprocess.call(cmd_list)
|
|
|
|
if retcode != 0:
|
|
|
|
print("Build failed: %s" % ' '.join(cmd_list))
|
|
|
|
sys.exit(1)
|
|
|
|
|
2021-06-21 23:05:04 -03:00
|
|
|
|
2018-10-29 22:54:48 -03:00
|
|
|
print("Building iofirmware")
|
|
|
|
run_program(["./waf", "configure", "--board", 'iomcu'])
|
|
|
|
run_program(["./waf", "clean"])
|
|
|
|
run_program(["./waf", "iofirmware"])
|
2019-07-21 23:52:15 -03:00
|
|
|
shutil.copy('build/iomcu/bin/iofirmware_lowpolh.bin', 'Tools/IO_Firmware/iofirmware_lowpolh.bin')
|
|
|
|
shutil.copy('build/iomcu/bin/iofirmware_highpolh.bin', 'Tools/IO_Firmware/iofirmware_highpolh.bin')
|
2021-12-19 17:49:48 -04:00
|
|
|
|
2022-08-29 01:48:04 -03:00
|
|
|
run_program(["./waf", "configure", "--board", 'iomcu-dshot'])
|
|
|
|
run_program(["./waf", "clean"])
|
|
|
|
run_program(["./waf", "iofirmware"])
|
|
|
|
shutil.copy('build/iomcu-dshot/bin/iofirmware_lowpolh.bin', 'Tools/IO_Firmware/iofirmware_dshot_lowpolh.bin')
|
|
|
|
shutil.copy('build/iomcu-dshot/bin/iofirmware_highpolh.bin', 'Tools/IO_Firmware/iofirmware_dshot_highpolh.bin')
|
|
|
|
|
|
|
|
|
2021-12-19 17:49:48 -04:00
|
|
|
run_program(["./waf", "configure", "--board", 'iomcu_f103_8MHz'])
|
|
|
|
run_program(["./waf", "clean"])
|
|
|
|
run_program(["./waf", "iofirmware"])
|
|
|
|
shutil.copy('build/iomcu_f103_8MHz/bin/iofirmware_lowpolh.bin', 'Tools/IO_Firmware/iofirmware_f103_8MHz_lowpolh.bin')
|
|
|
|
shutil.copy('build/iomcu_f103_8MHz/bin/iofirmware_highpolh.bin', 'Tools/IO_Firmware/iofirmware_f103_8MHz_highpolh.bin')
|