Plane: Prevent quadplane.assign_tilt_to_fwd_thr() being called twice

This commit is contained in:
Paul Riseborough 2023-09-13 22:03:32 +10:00 committed by Andrew Tridgell
parent c2d6db13ec
commit fb7c383946
1 changed files with 4 additions and 1 deletions

View File

@ -36,8 +36,11 @@ void ModeQStabilize::update()
plane.nav_pitch_cd = pitch_input * plane.quadplane.aparm.angle_max;
}
if (plane.control_mode->mode_number() == Mode::Number::QSTABILIZE) {
// protect against this function running twice
plane.quadplane.assign_tilt_to_fwd_thr();
}
}
// quadplane stabilize mode
void ModeQStabilize::run()