From 21c9c62ed98b87bcc759f0a6c23df581a548de5d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Aug 2022 19:04:31 +1000 Subject: [PATCH] waf: added OpenDroneID support --- Tools/ardupilotwaf/ardupilotwaf.py | 1 + Tools/ardupilotwaf/boards.py | 22 ++++++++++++++++++++++ wscript | 9 +++++++++ 3 files changed, 32 insertions(+) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index 70aaa64bad..34391a8791 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -90,6 +90,7 @@ COMMON_VEHICLE_DEPENDENT_LIBRARIES = [ 'AC_PID', 'AP_SerialLED', 'AP_Hott_Telem', + 'AP_OpenDroneID', ] def get_legacy_defines(sketch_name): diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 31f5e74f18..b17f2dff83 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -70,6 +70,26 @@ class Board: else: cfg.options.disable_scripting = True; + # 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 # the priority. @@ -360,6 +380,8 @@ class sitl(Board): AP_SCRIPTING_CHECKS = 1, # SITL should always do runtime scripting checks ) + cfg.define('AP_OPENDRONEID_ENABLED', 1) + env.CXXFLAGS += [ '-Werror=float-equal' ] diff --git a/wscript b/wscript index 598a902e3c..dcd30accc4 100644 --- a/wscript +++ b/wscript @@ -205,6 +205,15 @@ configuration in order to save typing. default=False, help='Force a static build') + 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 = []