Tools: create_OEM_board.py: include line-feeds on include lines

This commit is contained in:
Peter Barker 2024-06-26 09:42:33 +10:00 committed by Peter Barker
parent 87909b5187
commit 72a1b97b4c

View File

@ -22,10 +22,10 @@ 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]) subprocess.run(["mkdir", "libraries/AP_HAL_ChibiOS/hwdef/%s" % oem_board_name])
# create files and add reference to originals # 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.write("include ../%s/hwdef.dat\n" % board_name)
f.close() 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.write("include ../%s/hwdef-bl.dat\n" % board_name)
f.close() f.close()
if os.path.exists("libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name): if os.path.exists("libraries/AP_HAL_ChibiOS/hwdef/%s/defaults.parm" % board_name):
path = pathlib.Path(f"libraries/AP_HAL_ChibiOS/hwdef/{oem_board_name}/defaults.parm") path = pathlib.Path(f"libraries/AP_HAL_ChibiOS/hwdef/{oem_board_name}/defaults.parm")