Browse Source

Copter: Remove redundant throttle channel setting

master
Michael du Breuil 7 years ago committed by Andrew Tridgell
parent
commit
5825222818
  1. 4
      ArduCopter/radio.cpp

4
ArduCopter/radio.cpp

@ -128,7 +128,6 @@ void Copter::set_throttle_and_failsafe(uint16_t throttle_pwm)
{ {
// if failsafe not enabled pass through throttle and exit // if failsafe not enabled pass through throttle and exit
if(g.failsafe_throttle == FS_THR_DISABLED) { if(g.failsafe_throttle == FS_THR_DISABLED) {
channel_throttle->set_pwm(throttle_pwm);
return; return;
} }
@ -137,7 +136,6 @@ void Copter::set_throttle_and_failsafe(uint16_t throttle_pwm)
// if we are already in failsafe or motors not armed pass through throttle and exit // if we are already in failsafe or motors not armed pass through throttle and exit
if (failsafe.radio || !(ap.rc_receiver_present || motors->armed())) { if (failsafe.radio || !(ap.rc_receiver_present || motors->armed())) {
channel_throttle->set_pwm(throttle_pwm);
return; return;
} }
@ -147,7 +145,6 @@ void Copter::set_throttle_and_failsafe(uint16_t throttle_pwm)
if( failsafe.radio_counter >= FS_COUNTER ) { if( failsafe.radio_counter >= FS_COUNTER ) {
failsafe.radio_counter = FS_COUNTER; // check to ensure we don't overflow the counter failsafe.radio_counter = FS_COUNTER; // check to ensure we don't overflow the counter
set_failsafe_radio(true); set_failsafe_radio(true);
channel_throttle->set_pwm(throttle_pwm); // pass through failsafe throttle
} }
}else{ }else{
// we have a good throttle so reduce failsafe counter // we have a good throttle so reduce failsafe counter
@ -161,7 +158,6 @@ void Copter::set_throttle_and_failsafe(uint16_t throttle_pwm)
} }
} }
// pass through throttle // pass through throttle
channel_throttle->set_pwm(throttle_pwm);
} }
} }

Loading…
Cancel
Save