diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 4f96db0f46..c330a55b7d 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -114,6 +114,23 @@ class Board: else: cfg.msg("Enabled firmware ID checking", 'no', color='YELLOW') + # allow enable of custom controller for any board + # enabled on sitl by default + if (cfg.options.enable_custom_controller or self.get_name() == "sitl") and not cfg.options.no_gcs: + env.ENABLE_CUSTOM_CONTROLLER = True + env.DEFINES.update( + AP_CUSTOMCONTROL_ENABLED=1, + ) + env.AP_LIBRARIES += [ + 'AC_CustomControl' + ] + cfg.msg("Enabled custom controller", 'yes') + else: + env.DEFINES.update( + AP_CUSTOMCONTROL_ENABLED=0, + ) + cfg.msg("Enabled custom controller", 'no', color='YELLOW') + d = env.get_merged_dict() # Always prepend so that arguments passed in the command line get # the priority. diff --git a/wscript b/wscript index 7308fe88c1..1df57ab1e7 100644 --- a/wscript +++ b/wscript @@ -238,6 +238,10 @@ submodules at specific revisions. default=False, help="Enables firmware ID checking on boot") + g.add_option('--enable-custom-controller', action='store_true', + default=False, + help="Enables custom controller") + g = opt.ap_groups['linux'] linux_options = ('--prefix', '--destdir', '--bindir', '--libdir')