diff --git a/libraries/AP_CustomRotations/AP_CustomRotations.cpp b/libraries/AP_CustomRotations/AP_CustomRotations.cpp index 0af266ea1f..ad938c1b10 100644 --- a/libraries/AP_CustomRotations/AP_CustomRotations.cpp +++ b/libraries/AP_CustomRotations/AP_CustomRotations.cpp @@ -1,3 +1,7 @@ +#include "AP_CustomRotations_config.h" + +#if AP_CUSTOMROTATIONS_ENABLED + #include "AP_CustomRotations.h" #include @@ -5,8 +9,6 @@ #include #include -#if !APM_BUILD_TYPE(APM_BUILD_AP_Periph) - const AP_Param::GroupInfo AP_CustomRotations::var_info[] = { // @Param: _ENABLE @@ -156,4 +158,4 @@ AP_CustomRotations &custom_rotations() } -#endif // !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#endif // AP_CUSTOMROTATIONS_ENABLED diff --git a/libraries/AP_CustomRotations/AP_CustomRotations.h b/libraries/AP_CustomRotations/AP_CustomRotations.h index f26c43b710..7b802334d8 100644 --- a/libraries/AP_CustomRotations/AP_CustomRotations.h +++ b/libraries/AP_CustomRotations/AP_CustomRotations.h @@ -14,6 +14,10 @@ */ #pragma once +#include "AP_CustomRotations_config.h" + +#if AP_CUSTOMROTATIONS_ENABLED + #include #include @@ -80,3 +84,5 @@ namespace AP { AP_CustomRotations &custom_rotations(); }; + +#endif // AP_CUSTOMROTATIONS_ENABLED diff --git a/libraries/AP_CustomRotations/AP_CustomRotations_config.h b/libraries/AP_CustomRotations/AP_CustomRotations_config.h new file mode 100644 index 0000000000..67aa8f5b95 --- /dev/null +++ b/libraries/AP_CustomRotations/AP_CustomRotations_config.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#ifndef AP_CUSTOMROTATIONS_ENABLED +#define AP_CUSTOMROTATIONS_ENABLED 1 +#endif diff --git a/libraries/AP_CustomRotations/AP_CustomRotations_params.cpp b/libraries/AP_CustomRotations/AP_CustomRotations_params.cpp index 07d260d2cb..b8904c1bd1 100644 --- a/libraries/AP_CustomRotations/AP_CustomRotations_params.cpp +++ b/libraries/AP_CustomRotations/AP_CustomRotations_params.cpp @@ -1,7 +1,8 @@ -#include "AP_CustomRotations.h" -#include +#include "AP_CustomRotations_config.h" -#if !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#if AP_CUSTOMROTATIONS_ENABLED + +#include "AP_CustomRotations.h" const AP_Param::GroupInfo AP_CustomRotation_params::var_info[] = { @@ -33,4 +34,4 @@ AP_CustomRotation_params::AP_CustomRotation_params() { AP_Param::setup_object_defaults(this, var_info); } -#endif // !APM_BUILD_TYPE(APM_BUILD_AP_Periph) +#endif // AP_CUSTOMROTATIONS_ENABLED