Browse Source

SRV_Channel: define aux functions for motors 9 to 12

master
Randy Mackay 8 years ago
parent
commit
544d6aa8a0
  1. 6
      libraries/SRV_Channel/SRV_Channel.cpp
  2. 7
      libraries/SRV_Channel/SRV_Channel.h
  3. 1
      libraries/SRV_Channel/SRV_Channel_aux.cpp

6
libraries/SRV_Channel/SRV_Channel.cpp

@ -182,3 +182,9 @@ uint16_t SRV_Channel::get_limit_pwm(LimitValue limit) const @@ -182,3 +182,9 @@ uint16_t SRV_Channel::get_limit_pwm(LimitValue limit) const
}
}
// return true if function is for a multicopter motor
bool SRV_Channel::is_motor(SRV_Channel::Aux_servo_function_t function)
{
return ((function >= SRV_Channel::k_motor1 && function <= SRV_Channel::k_motor8) ||
(function >= SRV_Channel::k_motor9 && function <= SRV_Channel::k_motor12));
}

7
libraries/SRV_Channel/SRV_Channel.h

@ -110,6 +110,10 @@ public: @@ -110,6 +110,10 @@ public:
k_vtail_left = 79,
k_vtail_right = 80,
k_boost_throttle = 81, ///< vertical booster throttle
k_motor9 = 82,
k_motor10 = 83,
k_motor11 = 84,
k_motor12 = 85,
k_nr_aux_servo_functions ///< This must be the last enum value (only add new values _before_ this one)
} Aux_servo_function_t;
@ -157,6 +161,9 @@ public: @@ -157,6 +161,9 @@ public:
return servo_trim;
}
// return true if function is for a multicopter motor
static bool is_motor(SRV_Channel::Aux_servo_function_t function);
private:
AP_Int16 servo_min;
AP_Int16 servo_max;

1
libraries/SRV_Channel/SRV_Channel_aux.cpp

@ -39,6 +39,7 @@ void SRV_Channel::output_ch(void) @@ -39,6 +39,7 @@ void SRV_Channel::output_ch(void)
passthrough_from = int8_t(function - k_rcin1);
break;
case k_motor1 ... k_motor8:
case k_motor9 ... k_motor12:
// handled by AP_Motors::rc_write()
return;
}

Loading…
Cancel
Save