Plane: only save gains if disarmed in autotune

This commit is contained in:
Peter Hall 2019-05-01 13:22:02 +01:00 committed by Andrew Tridgell
parent a0d8c04f3e
commit 0b1d392342

View File

@ -502,7 +502,11 @@ bool Plane::disarm_motors(void)
#if QAUTOTUNE_ENABLED
//save qautotune gains if enabled and success
if (control_mode == &mode_qautotune) {
quadplane.qautotune.save_tuning_gains();
} else {
quadplane.qautotune.reset();
}
#endif
return true;