AP_Compass: take responsibility for not running cal if armed

This commit is contained in:
Peter Barker 2019-03-25 20:06:34 +11:00 committed by Andrew Tridgell
parent f054301ec2
commit 0e8722181f
2 changed files with 6 additions and 2 deletions

View File

@ -123,7 +123,7 @@ public:
const Vector3f &get_field(void) const { return get_field(get_primary()); } const Vector3f &get_field(void) const { return get_field(get_primary()); }
// compass calibrator interface // compass calibrator interface
void compass_cal_update(); void cal_update();
// per-motor calibration access // per-motor calibration access
void per_motor_calibration_start(void) { void per_motor_calibration_start(void) {

View File

@ -7,8 +7,12 @@
extern AP_HAL::HAL& hal; extern AP_HAL::HAL& hal;
void void
Compass::compass_cal_update() Compass::cal_update()
{ {
if (hal.util->get_soft_armed()) {
return;
}
bool running = false; bool running = false;
for (uint8_t i=0; i<COMPASS_MAX_INSTANCES; i++) { for (uint8_t i=0; i<COMPASS_MAX_INSTANCES; i++) {