diff --git a/src/drivers/drv_pwm_output.h b/src/drivers/drv_pwm_output.h index 5dba02b79d..7cb8de9416 100644 --- a/src/drivers/drv_pwm_output.h +++ b/src/drivers/drv_pwm_output.h @@ -213,9 +213,6 @@ struct pwm_output_rc_config { /** get the maximum PWM value the output will send */ #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 */ #define PWM_SERVO_GET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 21) diff --git a/src/drivers/pwm_out/PWMOut.cpp b/src/drivers/pwm_out/PWMOut.cpp index aa37daabb0..9b3f0b9117 100644 --- a/src/drivers/pwm_out/PWMOut.cpp +++ b/src/drivers/pwm_out/PWMOut.cpp @@ -906,29 +906,6 @@ int PWMOut::pwm_ioctl(file *filp, int cmd, unsigned long arg) 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: { struct pwm_output_values *pwm = (struct pwm_output_values *)arg; diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index ea66d6a1e8..acd7c3b4c8 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -2647,20 +2647,6 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg) 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: { struct pwm_output_values *pwm = (struct pwm_output_values *)arg; pwm->channel_count = _max_actuators;