From 86e7c09cf027720fdb8ade727b90d44bb2f2e31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Aug 2022 18:13:04 +1000 Subject: [PATCH] waf: added OpenDroneID support --- Tools/ardupilotwaf/ardupilotwaf.py | 2 ++ Tools/ardupilotwaf/boards.py | 21 +++++++++++++++++++++ wscript | 11 ++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index f63a8d1bec..d56f29829a 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -107,6 +107,8 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AP_ExternalAHRS', 'AP_VideoTX', 'AP_FETtecOneWire', + 'AP_CheckFirmware', + 'AP_OpenDroneID', ] def get_legacy_defines(sketch_name): diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 36424299e6..5b043d049a 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -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) diff --git a/wscript b/wscript index 2effc8117d..b35754b733 100644 --- a/wscript +++ b/wscript @@ -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 = []