Plane: Remove redundant protection

This commit is contained in:
Michael du Breuil 2019-08-20 09:24:01 -07:00 committed by Francisco Ferreira
parent 851ee24c99
commit ea64077f77
1 changed files with 26 additions and 28 deletions

View File

@ -278,10 +278,10 @@ void Plane::control_failsafe()
}
}
if(g.throttle_fs_enabled == 0)
if(g.throttle_fs_enabled == 0) {
return;
}
if (g.throttle_fs_enabled) {
if (rc_failsafe_active()) {
// we detect a failsafe from radio
// throttle has dropped below the mark
@ -294,8 +294,7 @@ void Plane::control_failsafe()
if (failsafe.throttle_counter > 10) {
failsafe.throttle_counter = 10;
}
}else if(failsafe.throttle_counter > 0) {
} else if(failsafe.throttle_counter > 0) {
// we are no longer in failsafe condition
// but we need to recover quickly
failsafe.throttle_counter--;
@ -309,7 +308,6 @@ void Plane::control_failsafe()
AP_Notify::flags.failsafe_radio = false;
}
}
}
}
bool Plane::trim_radio()