mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
delete unused PWM_SERVO_SET_TRIM_PWM
This commit is contained in:
@@ -213,9 +213,6 @@ struct pwm_output_rc_config {
|
|||||||
/** get the maximum PWM value the output will send */
|
/** get the maximum PWM value the output will send */
|
||||||
#define PWM_SERVO_GET_MAX_PWM _PX4_IOC(_PWM_SERVO_BASE, 19)
|
#define PWM_SERVO_GET_MAX_PWM _PX4_IOC(_PWM_SERVO_BASE, 19)
|
||||||
|
|
||||||
/** set the TRIM value the output will send */
|
|
||||||
#define PWM_SERVO_SET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 20)
|
|
||||||
|
|
||||||
/** get the TRIM value the output will send */
|
/** get the TRIM value the output will send */
|
||||||
#define PWM_SERVO_GET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 21)
|
#define PWM_SERVO_GET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 21)
|
||||||
|
|
||||||
|
|||||||
@@ -906,29 +906,6 @@ int PWMOut::pwm_ioctl(file *filp, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PWM_SERVO_SET_TRIM_PWM: {
|
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
|
||||||
|
|
||||||
/* discard if too many values are sent */
|
|
||||||
if (pwm->channel_count > FMU_MAX_ACTUATORS) {
|
|
||||||
PX4_DEBUG("error: too many trim values: %d", pwm->channel_count);
|
|
||||||
ret = -EINVAL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_mixing_output.mixers() == nullptr) {
|
|
||||||
PX4_ERR("error: no mixer loaded");
|
|
||||||
ret = -EIO;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy the trim values to the mixer offsets */
|
|
||||||
_mixing_output.mixers()->set_trims((int16_t *)pwm->values, pwm->channel_count);
|
|
||||||
PX4_DEBUG("set_trims: %d, %d, %d, %d", pwm->values[0], pwm->values[1], pwm->values[2], pwm->values[3]);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case PWM_SERVO_GET_TRIM_PWM: {
|
case PWM_SERVO_GET_TRIM_PWM: {
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||||
|
|
||||||
|
|||||||
@@ -2647,20 +2647,6 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PWM_SERVO_SET_TRIM_PWM: {
|
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
|
||||||
|
|
||||||
if (pwm->channel_count > _max_actuators)
|
|
||||||
/* fail with error */
|
|
||||||
{
|
|
||||||
return -E2BIG;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy values to registers in IO */
|
|
||||||
ret = io_reg_set(PX4IO_PAGE_CONTROL_TRIM_PWM, 0, pwm->values, pwm->channel_count);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case PWM_SERVO_GET_TRIM_PWM: {
|
case PWM_SERVO_GET_TRIM_PWM: {
|
||||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||||
pwm->channel_count = _max_actuators;
|
pwm->channel_count = _max_actuators;
|
||||||
|
|||||||
Reference in New Issue
Block a user