diff --git a/libraries/AP_Compass/AP_Compass.h b/libraries/AP_Compass/AP_Compass.h index be91d60962..b8d5aeead5 100644 --- a/libraries/AP_Compass/AP_Compass.h +++ b/libraries/AP_Compass/AP_Compass.h @@ -51,8 +51,12 @@ #ifndef HAL_COMPASS_MAX_SENSORS #define HAL_COMPASS_MAX_SENSORS 3 #endif +#if HAL_COMPASS_MAX_SENSORS > 1 #define COMPASS_MAX_UNREG_DEV 5 #else +#define COMPASS_MAX_UNREG_DEV 0 +#endif +#else #ifndef HAL_COMPASS_MAX_SENSORS #define HAL_COMPASS_MAX_SENSORS 1 #endif diff --git a/libraries/AP_Compass/AP_Compass_Calibration.cpp b/libraries/AP_Compass/AP_Compass_Calibration.cpp index b64cc80bdb..2f004b9929 100644 --- a/libraries/AP_Compass/AP_Compass_Calibration.cpp +++ b/libraries/AP_Compass/AP_Compass_Calibration.cpp @@ -53,10 +53,13 @@ bool Compass::_start_calibration(uint8_t i, bool retry, float delay) return false; } Priority prio = Priority(i); + +#if COMPASS_MAX_INSTANCES > 1 if (_priority_did_list[prio] != _priority_did_stored_list[prio]) { gcs().send_text(MAV_SEVERITY_ERROR, "Compass cal requires reboot after priority change"); return false; } +#endif if (_calibrator[prio] == nullptr) { _calibrator[prio] = new CompassCalibrator();