AP_Compass: add and use AP_CUSTOMROTATIONS_ENABLED

also add to build_options.py
This commit is contained in:
Peter Barker 2024-02-29 15:39:18 +11:00 committed by Peter Barker
parent a836bd8583
commit 093deed610

View File

@ -731,7 +731,7 @@ void Compass::init()
// convert to new custom rotation method
// PARAMETER_CONVERSION - Added: Nov-2021
#if !APM_BUILD_TYPE(APM_BUILD_AP_Periph)
#if AP_CUSTOMROTATIONS_ENABLED
for (StateIndex i(0); i<COMPASS_MAX_INSTANCES; i++) {
if (_state[i].orientation != ROTATION_CUSTOM_OLD) {
continue;
@ -751,7 +751,7 @@ void Compass::init()
}
break;
}
#endif // !APM_BUILD_TYPE(APM_BUILD_AP_Periph)
#endif // AP_CUSTOMROTATIONS_ENABLED
#if COMPASS_MAX_INSTANCES > 1
// Look if there was a primary compass setup in previous version