mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
waf: use new syntax for chibios_hwdef.py
This commit is contained in:
parent
b4b02b4ffc
commit
d6088539b7
@ -382,9 +382,11 @@ def generate_hwdef_h(env):
|
|||||||
if not os.path.exists(hwdef_out):
|
if not os.path.exists(hwdef_out):
|
||||||
os.mkdir(hwdef_out)
|
os.mkdir(hwdef_out)
|
||||||
python = sys.executable
|
python = sys.executable
|
||||||
cmd = "{0} '{1}' -D '{2}' '{3}' {4} --params '{5}'".format(python, hwdef_script, hwdef_out, env.HWDEF, env.BOOTLOADER_OPTION, env.DEFAULT_PARAMETERS)
|
cmd = "{0} '{1}' -D '{2}' --params '{3}' '{4}'".format(python, hwdef_script, hwdef_out, env.DEFAULT_PARAMETERS, env.HWDEF)
|
||||||
if env.HWDEF_EXTRA:
|
if env.HWDEF_EXTRA:
|
||||||
cmd += " --extra-hwdef '{0}'".format(env.HWDEF_EXTRA)
|
cmd += " '{0}'".format(env.HWDEF_EXTRA)
|
||||||
|
if env.BOOTLOADER_OPTION:
|
||||||
|
cmd += " " + env.BOOTLOADER_OPTION
|
||||||
return subprocess.call(cmd, shell=True)
|
return subprocess.call(cmd, shell=True)
|
||||||
|
|
||||||
def pre_build(bld):
|
def pre_build(bld):
|
||||||
@ -405,11 +407,21 @@ def pre_build(bld):
|
|||||||
|
|
||||||
def build(bld):
|
def build(bld):
|
||||||
|
|
||||||
|
|
||||||
|
hwdef_rule="%s '%s/hwdef/scripts/chibios_hwdef.py' -D '%s' --params '%s' '%s'" % (
|
||||||
|
bld.env.get_flat('PYTHON'),
|
||||||
|
bld.env.AP_HAL_ROOT,
|
||||||
|
bld.env.BUILDROOT,
|
||||||
|
bld.env.default_parameters,
|
||||||
|
bld.env.HWDEF)
|
||||||
|
if bld.env.HWDEF_EXTRA:
|
||||||
|
hwdef_rule += " " + bld.env.HWDEF_EXTRA
|
||||||
|
if bld.env.BOOTLOADER_OPTION:
|
||||||
|
hwdef_rule += " " + bld.env.BOOTLOADER_OPTION
|
||||||
bld(
|
bld(
|
||||||
# build hwdef.h from hwdef.dat. This is needed after a waf clean
|
# build hwdef.h from hwdef.dat. This is needed after a waf clean
|
||||||
source=bld.path.ant_glob(bld.env.HWDEF),
|
source=bld.path.ant_glob(bld.env.HWDEF),
|
||||||
rule="%s '${AP_HAL_ROOT}/hwdef/scripts/chibios_hwdef.py' -D '${BUILDROOT}' '%s' %s --params '%s'" % (
|
rule=hwdef_rule,
|
||||||
bld.env.get_flat('PYTHON'), bld.env.HWDEF, bld.env.BOOTLOADER_OPTION, bld.env.default_parameters),
|
|
||||||
group='dynamic_sources',
|
group='dynamic_sources',
|
||||||
target=[bld.bldnode.find_or_declare('hwdef.h'),
|
target=[bld.bldnode.find_or_declare('hwdef.h'),
|
||||||
bld.bldnode.find_or_declare('ldscript.ld'),
|
bld.bldnode.find_or_declare('ldscript.ld'),
|
||||||
|
Loading…
Reference in New Issue
Block a user