chibios_hwdef.py: allow re-use of bootloader from other boards

This commit is contained in:
Peter Barker 2024-02-10 11:26:58 +11:00 committed by Peter Barker
parent 81f2e15f8b
commit 1862b5dc27

View File

@ -2413,6 +2413,10 @@ INCLUDE common.ld
this_dir = os.path.realpath(__file__)
rootdir = os.path.relpath(os.path.join(this_dir, "../../../../.."))
hwdef_dirname = os.path.basename(os.path.dirname(args.hwdef[0]))
# allow re-using of bootloader from different build:
use_bootloader_from_board = self.get_config('USE_BOOTLOADER_FROM_BOARD', default=None, required=False)
if use_bootloader_from_board is not None:
hwdef_dirname = use_bootloader_from_board
bootloader_filename = "%s_bl.bin" % (hwdef_dirname,)
bootloader_path = os.path.join(rootdir,
"Tools",