From 8af84cf236efaf28dd7dd6a3b3916f88a8767d99 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 15 Jul 2022 21:50:11 +1000 Subject: [PATCH] AP_ICEngine: add and use AP_ICENGINE_ENABLE --- libraries/AP_ICEngine/AP_ICEngine.cpp | 7 +++++-- libraries/AP_ICEngine/AP_ICEngine.h | 7 +++++++ libraries/AP_ICEngine/AP_ICEngine_config.h | 7 +++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 libraries/AP_ICEngine/AP_ICEngine_config.h diff --git a/libraries/AP_ICEngine/AP_ICEngine.cpp b/libraries/AP_ICEngine/AP_ICEngine.cpp index c212abe9d2..230d8d8cf2 100644 --- a/libraries/AP_ICEngine/AP_ICEngine.cpp +++ b/libraries/AP_ICEngine/AP_ICEngine.cpp @@ -13,6 +13,9 @@ along with this program. If not, see . */ +#include "AP_ICEngine.h" + +#if AP_ICENGINE_ENABLED #include #include @@ -20,8 +23,6 @@ #include #include #include -#include -#include "AP_ICEngine.h" #include extern const AP_HAL::HAL& hal; @@ -533,3 +534,5 @@ AP_ICEngine *ice() { return AP_ICEngine::get_singleton(); } } + +#endif // AP_ICENGINE_ENABLED diff --git a/libraries/AP_ICEngine/AP_ICEngine.h b/libraries/AP_ICEngine/AP_ICEngine.h index dd6bb6123e..f5a1818f22 100644 --- a/libraries/AP_ICEngine/AP_ICEngine.h +++ b/libraries/AP_ICEngine/AP_ICEngine.h @@ -18,7 +18,12 @@ */ #pragma once +#include "AP_ICEngine_config.h" + +#if AP_ICENGINE_ENABLED + #include +#include class AP_ICEngine { public: @@ -151,3 +156,5 @@ private: namespace AP { AP_ICEngine *ice(); }; + +#endif // AP_ICENGINE_ENABLED diff --git a/libraries/AP_ICEngine/AP_ICEngine_config.h b/libraries/AP_ICEngine/AP_ICEngine_config.h new file mode 100644 index 0000000000..c609d429f1 --- /dev/null +++ b/libraries/AP_ICEngine/AP_ICEngine_config.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#ifndef AP_ICENGINE_ENABLED +#define AP_ICENGINE_ENABLED 1 +#endif