Copter: do no compass stick gesture detection while armed

This commit is contained in:
Peter Barker 2019-03-25 20:22:28 +11:00 committed by Andrew Tridgell
parent 09a11429e1
commit 7207035c34
1 changed files with 5 additions and 3 deletions

View File

@ -107,12 +107,14 @@ void Copter::init_optflow()
void Copter::compass_cal_update()
{
static uint32_t compass_cal_stick_gesture_begin = 0;
compass.cal_update();
if (!hal.util->get_soft_armed()) {
compass.compass_cal_update();
if (hal.util->get_soft_armed()) {
return;
}
static uint32_t compass_cal_stick_gesture_begin = 0;
if (compass.is_calibrating()) {
if (channel_yaw->get_control_in() < -4000 && channel_throttle->get_control_in() > 900) {
compass.cancel_calibration_all();