SRV_Channel: Remove the trim_all interface, constrain failsafes to non motor outputs

This commit is contained in:
Michael du Breuil 2018-08-22 00:18:36 -07:00 committed by Andrew Tridgell
parent 460455a687
commit 8850e4b9a1
2 changed files with 5 additions and 13 deletions

View File

@ -312,11 +312,8 @@ public:
flags.k_throttle_reversible = true;
}
// set all outputs to the TRIM value
static void output_trim_all(void);
// setup IO failsafe for all channels to trim
static void setup_failsafe_trim_all(void);
static void setup_failsafe_trim_all_non_motors(void);
// set output for all channels matching the given function type, allow radio_trim to center servo
static void set_output_pwm_trimmed(SRV_Channel::Aux_servo_function_t function, int16_t value);

View File

@ -178,19 +178,14 @@ void SRV_Channels::save_trim(void)
trimmed_mask = 0;
}
void SRV_Channels::output_trim_all(void)
{
for (uint8_t i=0; i<NUM_SERVO_CHANNELS; i++) {
channels[i].set_output_pwm(channels[i].servo_trim);
}
}
void SRV_Channels::setup_failsafe_trim_all(void)
void SRV_Channels::setup_failsafe_trim_all_non_motors(void)
{
for (uint8_t i = 0; i < NUM_SERVO_CHANNELS; i++) {
if (!SRV_Channel::is_motor(channels[i].get_function())) {
hal.rcout->set_failsafe_pwm(1U<<channels[i].ch_num, channels[i].servo_trim);
}
}
}
/*
run calc_pwm for all channels