waf: added OpenDroneID support

This commit is contained in:
Andrew Tridgell 2022-08-28 18:13:04 +10:00
parent 6a4710938c
commit 86e7c09cf0
3 changed files with 33 additions and 1 deletions

View File

@ -107,6 +107,8 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [
'AP_ExternalAHRS',
'AP_VideoTX',
'AP_FETtecOneWire',
'AP_CheckFirmware',
'AP_OpenDroneID',
]
def get_legacy_defines(sketch_name):

View File

@ -67,6 +67,26 @@ class Board:
# allow GCS disable for AP_DAL example
if cfg.options.no_gcs:
env.CXXFLAGS += ['-DHAL_NO_GCS=1']
# allow enable of OpenDroneID for any board
if cfg.options.enable_opendroneid:
env.ENABLE_OPENDRONEID = True
env.DEFINES.update(
AP_OPENDRONEID_ENABLED=1,
)
cfg.msg("Enabled OpenDroneID", 'yes')
else:
cfg.msg("Enabled OpenDroneID", 'no', color='YELLOW')
# allow enable of firmware ID checking for any board
if cfg.options.enable_check_firmware:
env.CHECK_FIRMWARE_ENABLED = True
env.DEFINES.update(
AP_CHECK_FIRMWARE_ENABLED=1,
)
cfg.msg("Enabled firmware ID checking", 'yes')
else:
cfg.msg("Enabled firmware ID checking", 'no', color='YELLOW')
d = env.get_merged_dict()
# Always prepend so that arguments passed in the command line get
@ -461,6 +481,7 @@ class sitl(Board):
AP_SCRIPTING_CHECKS = 1, # SITL should always do runtime scripting checks
)
cfg.define('AP_OPENDRONEID_ENABLED', 1)
if self.with_can:
cfg.define('HAL_NUM_CAN_IFACES', 2)

11
wscript
View File

@ -271,7 +271,16 @@ configuration in order to save typing.
action='store_true',
default=False,
help='force single precision postype_t')
g.add_option('--enable-opendroneid', action='store_true',
default=False,
help="Enables OpenDroneID")
g.add_option('--enable-check-firmware', action='store_true',
default=False,
help="Enables firmware ID checking on boot")
def _collect_autoconfig_files(cfg):
for m in sys.modules.values():
paths = []