mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
Copter: Use the compass calibrator autoreboot behaviour
(fixes a chance of not saving the second compass)
This commit is contained in:
parent
fd24e944b8
commit
790ddeb04e
@ -192,14 +192,6 @@ void Copter::compass_cal_update()
|
||||
compass.compass_cal_update();
|
||||
}
|
||||
|
||||
#ifdef CAL_ALWAYS_REBOOT
|
||||
if (compass.compass_cal_requires_reboot()) {
|
||||
hal.scheduler->delay(1000);
|
||||
hal.scheduler->reboot(false);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (compass.is_calibrating()) {
|
||||
if (channel_yaw->get_control_in() < -4000 && channel_throttle->get_control_in() > 900) {
|
||||
compass.cancel_calibration_all();
|
||||
@ -211,7 +203,11 @@ void Copter::compass_cal_update()
|
||||
if (!stick_gesture_detected) {
|
||||
compass_cal_stick_gesture_begin = tnow;
|
||||
} else if (tnow-compass_cal_stick_gesture_begin > 1000*COMPASS_CAL_STICK_GESTURE_TIME) {
|
||||
#ifdef CAL_ALWAYS_REBOOT
|
||||
compass.start_calibration_all(true,true,COMPASS_CAL_STICK_DELAY,true);
|
||||
#else
|
||||
compass.start_calibration_all(true,true,COMPASS_CAL_STICK_DELAY,false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user