diff --git a/libraries/AC_Fence/AC_Fence.cpp b/libraries/AC_Fence/AC_Fence.cpp index 1504c8ec4e..ba050f62d5 100644 --- a/libraries/AC_Fence/AC_Fence.cpp +++ b/libraries/AC_Fence/AC_Fence.cpp @@ -1,11 +1,11 @@ #include "AC_Fence.h" -#if AC_FENCE +#if AP_FENCE_ENABLED #include #ifndef AC_FENCE_DUMMY_METHODS_ENABLED -#define AC_FENCE_DUMMY_METHODS_ENABLED !(APM_BUILD_TYPE(APM_BUILD_Rover) | APM_BUILD_COPTER_OR_HELI | APM_BUILD_TYPE(APM_BUILD_ArduPlane) | APM_BUILD_TYPE(APM_BUILD_ArduSub)) +#define AC_FENCE_DUMMY_METHODS_ENABLED (!(APM_BUILD_TYPE(APM_BUILD_Rover) | APM_BUILD_COPTER_OR_HELI | APM_BUILD_TYPE(APM_BUILD_ArduPlane) | APM_BUILD_TYPE(APM_BUILD_ArduSub))) #endif #if !AC_FENCE_DUMMY_METHODS_ENABLED @@ -756,4 +756,4 @@ AC_Fence *fence() } -#endif // AC_FENCE +#endif // AP_FENCE_ENABLED diff --git a/libraries/AC_Fence/AC_Fence.h b/libraries/AC_Fence/AC_Fence.h index 03da189b1f..9fed988eb5 100644 --- a/libraries/AC_Fence/AC_Fence.h +++ b/libraries/AC_Fence/AC_Fence.h @@ -1,17 +1,15 @@ #pragma once +#include "AC_Fence_config.h" + +#if AP_FENCE_ENABLED + #include #include #include #include #include -#ifndef AC_FENCE -#define AC_FENCE 1 -#endif - -#if AC_FENCE - // bit masks for enabled fence types. Used for TYPE parameter #define AC_FENCE_TYPE_ALT_MAX 1 // high alt fence which usually initiates an RTL #define AC_FENCE_TYPE_CIRCLE 2 // circular horizontal fence (usually initiates an RTL) @@ -231,4 +229,4 @@ namespace AP { AC_Fence *fence(); }; -#endif // AC_FENCE +#endif // AP_FENCE_ENABLED diff --git a/libraries/AC_Fence/AC_PolyFence_loader.cpp b/libraries/AC_Fence/AC_PolyFence_loader.cpp index d8d2b0bb09..ccdb456b94 100644 --- a/libraries/AC_Fence/AC_PolyFence_loader.cpp +++ b/libraries/AC_Fence/AC_PolyFence_loader.cpp @@ -1,8 +1,11 @@ #include "AC_PolyFence_loader.h" + +#if AP_FENCE_ENABLED + #include #ifndef AC_FENCE_DUMMY_METHODS_ENABLED -#define AC_FENCE_DUMMY_METHODS_ENABLED !(APM_BUILD_TYPE(APM_BUILD_Rover) | APM_BUILD_COPTER_OR_HELI | APM_BUILD_TYPE(APM_BUILD_ArduPlane) | APM_BUILD_TYPE(APM_BUILD_ArduSub)) +#define AC_FENCE_DUMMY_METHODS_ENABLED (!(APM_BUILD_TYPE(APM_BUILD_Rover) | APM_BUILD_COPTER_OR_HELI | APM_BUILD_TYPE(APM_BUILD_ArduPlane) | APM_BUILD_TYPE(APM_BUILD_ArduSub))) #endif #if !AC_FENCE_DUMMY_METHODS_ENABLED @@ -1698,3 +1701,4 @@ bool AC_PolyFence_loader::get_return_point(Vector2l &ret) { return false; } #endif #endif // #if AC_FENCE_DUMMY_METHODS_ENABLED +#endif // AP_FENCE_ENABLED diff --git a/libraries/AC_Fence/AC_PolyFence_loader.h b/libraries/AC_Fence/AC_PolyFence_loader.h index 4427cc646a..f38ee6b11a 100644 --- a/libraries/AC_Fence/AC_PolyFence_loader.h +++ b/libraries/AC_Fence/AC_PolyFence_loader.h @@ -1,5 +1,9 @@ #pragma once +#include "AC_Fence_config.h" + +#if AP_FENCE_ENABLED + #include #include #include @@ -434,3 +438,5 @@ private: uint16_t fence_storage_space_required(const AC_PolyFenceItem *new_items, uint16_t count); }; + +#endif // AP_FENCE_ENABLED