mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Tools: make create_OEM_board.py flake8-clean
This commit is contained in:
parent
580199dfba
commit
cd2a30ccda
@ -3,6 +3,8 @@
|
||||
"""
|
||||
script to automatically create a copy of a board for an OEM setup
|
||||
usage example : ./Tools/scripts/create_OEM_board.py mRoPixracerPro mRoPixracerPro-MyCompany
|
||||
|
||||
AP_FLAKE8_CLEAN
|
||||
"""
|
||||
|
||||
import sys
|
||||
@ -17,13 +19,15 @@ oem_board_name = sys.argv[2]
|
||||
if not os.path.exists("libraries/AP_HAL_ChibiOS/hwdef/%s" % oem_board_name):
|
||||
subprocess.run(["mkdir", "libraries/AP_HAL_ChibiOS/hwdef/%s" % oem_board_name])
|
||||
# create files and add reference to originals
|
||||
f=open("libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef.dat" % oem_board_name, "x")
|
||||
f = open("libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef.dat" % oem_board_name, "x")
|
||||
f.write("include ../%s/hwdef.dat" % board_name)
|
||||
f.close()
|
||||
f=open("libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef-bl.dat" % oem_board_name, "x")
|
||||
f = open("libraries/AP_HAL_ChibiOS/hwdef/%s/hwdef-bl.dat" % oem_board_name, "x")
|
||||
f.write("include ../%s/hwdef-bl.dat" % board_name)
|
||||
f.close()
|
||||
if os.path.exists("libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name):
|
||||
subprocess.run(["cp", "libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name, "libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % oem_board_name])
|
||||
|
||||
|
||||
subprocess.run([
|
||||
"cp",
|
||||
"libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name,
|
||||
"libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % oem_board_name,
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user