From 6ce546d2fb8c8542c337ff21d627b95b8084889f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 6 Feb 2023 16:39:02 +1100 Subject: [PATCH] AP_AdvancedFailsafe: add and use AP_ADVANCEDFAILSAFE_ENABLED --- libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp | 7 ++++++- libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h | 6 ++++++ libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe_config.h | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe_config.h diff --git a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp index c689d2e247..dce629b7a9 100644 --- a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp +++ b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp @@ -19,8 +19,11 @@ This is an advanced failsafe module originally modelled on the failsafe rules of the Outback Challenge */ -#include #include "AP_AdvancedFailsafe.h" + +#if AP_ADVANCEDFAILSAFE_ENABLED + +#include #include #include #include @@ -472,3 +475,5 @@ AP_AdvancedFailsafe *advancedfailsafe() } }; + +#endif // AP_ADVANCEDFAILSAFE_ENABLED diff --git a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h index c4fb7b2d6b..ecf50386c6 100644 --- a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h +++ b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h @@ -20,6 +20,10 @@ Andrew Tridgell and CanberraUAV, August 2012 */ +#include "AP_AdvancedFailsafe_config.h" + +#if AP_ADVANCEDFAILSAFE_ENABLED + #include #include #include @@ -163,3 +167,5 @@ private: namespace AP { AP_AdvancedFailsafe *advancedfailsafe(); }; + +#endif // AP_ADVANCEDFAILSAFE_ENABLED diff --git a/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe_config.h b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe_config.h new file mode 100644 index 0000000000..0a804e9dc1 --- /dev/null +++ b/libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe_config.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#ifndef AP_ADVANCEDFAILSAFE_ENABLED +#define AP_ADVANCEDFAILSAFE_ENABLED 1 +#endif