diff --git a/libraries/AP_Compass/AP_Compass_Calibration.cpp b/libraries/AP_Compass/AP_Compass_Calibration.cpp index 75bf834375..aac5a4bf9c 100644 --- a/libraries/AP_Compass/AP_Compass_Calibration.cpp +++ b/libraries/AP_Compass/AP_Compass_Calibration.cpp @@ -208,7 +208,7 @@ bool Compass::send_mag_cal_progress(const GCS_MAVLINK& link) cal_status == COMPASS_CAL_RUNNING_STEP_ONE || cal_status == COMPASS_CAL_RUNNING_STEP_TWO) { uint8_t completion_pct = calibrator.get_completion_percent(); - auto& completion_mask = calibrator.get_completion_mask(); + const CompassCalibrator::completion_mask_t& completion_mask = calibrator.get_completion_mask(); const Vector3f direction; uint8_t attempt = _calibrator[compass_id].get_attempt(); diff --git a/libraries/AP_Compass/CompassCalibrator.cpp b/libraries/AP_Compass/CompassCalibrator.cpp index a41ec94946..618639953a 100644 --- a/libraries/AP_Compass/CompassCalibrator.cpp +++ b/libraries/AP_Compass/CompassCalibrator.cpp @@ -147,11 +147,6 @@ void CompassCalibrator::update_completion_mask() } } -CompassCalibrator::completion_mask_t& CompassCalibrator::get_completion_mask() -{ - return _completion_mask; -} - bool CompassCalibrator::check_for_timeout() { uint32_t tnow = AP_HAL::millis(); if(running() && tnow - _last_sample_ms > 1000) { diff --git a/libraries/AP_Compass/CompassCalibrator.h b/libraries/AP_Compass/CompassCalibrator.h index 233ecbed74..d65a2d4a00 100644 --- a/libraries/AP_Compass/CompassCalibrator.h +++ b/libraries/AP_Compass/CompassCalibrator.h @@ -50,7 +50,7 @@ public: enum Rotation get_original_orientation() const { return _orig_orientation; } float get_completion_percent() const; - completion_mask_t& get_completion_mask(); + const completion_mask_t& get_completion_mask() const { return _completion_mask; } enum compass_cal_status_t get_status() const { return _status; } float get_fitness() const { return sqrtf(_fitness); } float get_orientation_confidence() const { return _orientation_confidence; }