Copter: minor format fixes to get_pilot_desired_cilmb_rate

This commit is contained in:
Randy Mackay 2019-04-11 11:33:21 +09:00
parent a2ac0875a7
commit a732dfed6d

View File

@ -75,7 +75,7 @@ void Copter::set_throttle_takeoff()
float Copter::get_pilot_desired_climb_rate(float throttle_control)
{
// throttle failsafe check
if( failsafe.radio ) {
if (failsafe.radio) {
return 0.0f;
}
@ -86,7 +86,7 @@ float Copter::get_pilot_desired_climb_rate(float throttle_control)
g2.toy_mode.throttle_adjust(throttle_control);
}
#endif
float desired_rate = 0.0f;
float mid_stick = get_throttle_mid();
float deadband_top = mid_stick + g.throttle_deadzone;
@ -102,10 +102,10 @@ float Copter::get_pilot_desired_climb_rate(float throttle_control)
if (throttle_control < deadband_bottom) {
// below the deadband
desired_rate = get_pilot_speed_dn() * (throttle_control-deadband_bottom) / deadband_bottom;
}else if (throttle_control > deadband_top) {
} else if (throttle_control > deadband_top) {
// above the deadband
desired_rate = g.pilot_speed_up * (throttle_control-deadband_top) / (1000.0f-deadband_top);
}else{
} else {
// must be in the deadband
desired_rate = 0.0f;
}