SRV_Channel: define aux functions for motors 9 to 12

This commit is contained in:
Randy Mackay 2017-05-18 23:16:51 +09:00
parent bf4a505494
commit 544d6aa8a0
3 changed files with 14 additions and 0 deletions

View File

@ -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));
}

View File

@ -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:
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;

View File

@ -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;
}