Browse Source

SRV_Channel: add k_min, m_trim and k_max to output min/trim/max values

zr-v5.1
Peter Barker 5 years ago committed by Andrew Tridgell
parent
commit
3264fd750b
  1. 3
      libraries/SRV_Channel/SRV_Channel.h
  2. 13
      libraries/SRV_Channel/SRV_Channel_aux.cpp

3
libraries/SRV_Channel/SRV_Channel.h

@ -158,6 +158,9 @@ public: @@ -158,6 +158,9 @@ public:
k_ProfiLED_3 = 131,
k_ProfiLED_Clock = 132,
k_winch_clutch = 133,
k_min = 134, // always outputs SERVOn_MIN
k_trim = 135, // always outputs SERVOn_TRIM
k_max = 136, // always outputs SERVOn_MAX
k_nr_aux_servo_functions ///< This must be the last enum value (only add new values _before_ this one)
} Aux_servo_function_t;

13
libraries/SRV_Channel/SRV_Channel_aux.cpp

@ -197,6 +197,19 @@ void SRV_Channels::enable_aux_servos() @@ -197,6 +197,19 @@ void SRV_Channels::enable_aux_servos()
hal.rcout->enable_ch(c.ch_num);
}
// output some servo functions before we fiddle with the
// parameter values:
if (c.function.get() == SRV_Channel::k_min) {
c.set_output_pwm(c.servo_min);
c.output_ch();
} else if (c.function.get() == SRV_Channel::k_trim) {
c.set_output_pwm(c.servo_trim);
c.output_ch();
} else if (c.function.get() == SRV_Channel::k_max) {
c.set_output_pwm(c.servo_max);
c.output_ch();
}
/*
for channels which have been marked as digital output then the
MIN/MAX/TRIM values have no meaning for controlling output, as

Loading…
Cancel
Save