mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 21:03:34 +08:00
delete PWM_SERVO_GET_TRIM_PWM
This commit is contained in:
@@ -188,9 +188,6 @@ typedef uint16_t servo_position_t;
|
||||
/** get the maximum PWM value the output will send */
|
||||
#define PWM_SERVO_GET_MAX_PWM _PX4_IOC(_PWM_SERVO_BASE, 19)
|
||||
|
||||
/** get the TRIM value the output will send */
|
||||
#define PWM_SERVO_GET_TRIM_PWM _PX4_IOC(_PWM_SERVO_BASE, 21)
|
||||
|
||||
/** force safety switch off (to disable use of safety switch) */
|
||||
#define PWM_SERVO_SET_FORCE_SAFETY_OFF _PX4_IOC(_PWM_SERVO_BASE, 25)
|
||||
|
||||
|
||||
@@ -855,20 +855,6 @@ int PWMOut::pwm_ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case PWM_SERVO_GET_TRIM_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
if (_mixing_output.mixers() == nullptr) {
|
||||
memset(pwm, 0, sizeof(pwm_output_values));
|
||||
PX4_WARN("warning: trim values not valid - no mixer loaded");
|
||||
|
||||
} else {
|
||||
|
||||
pwm->channel_count = _mixing_output.mixers()->get_trims((int16_t *)pwm->values);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(DIRECT_PWM_OUTPUT_CHANNELS) && DIRECT_PWM_OUTPUT_CHANNELS >= 14
|
||||
|
||||
case PWM_SERVO_SET(13):
|
||||
|
||||
@@ -176,17 +176,6 @@ PWMSim::ioctl(device::file_t *filp, int cmd, unsigned long arg)
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_TRIM_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
for (unsigned i = 0; i < OutputModuleInterface::MAX_ACTUATORS; i++) {
|
||||
pwm->values[i] = (_mixing_output.maxValue(i) + _mixing_output.minValue(i)) / 2;
|
||||
}
|
||||
|
||||
pwm->channel_count = OutputModuleInterface::MAX_ACTUATORS;
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_MAX_PWM: {
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
|
||||
|
||||
@@ -1735,22 +1735,6 @@ int PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
||||
}
|
||||
break;
|
||||
|
||||
case PWM_SERVO_GET_TRIM_PWM: {
|
||||
PX4_DEBUG("PWM_SERVO_GET_TRIM_PWM");
|
||||
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
|
||||
pwm->channel_count = _max_actuators;
|
||||
|
||||
if (_mixing_output.mixers() == nullptr) {
|
||||
memset(pwm, 0, sizeof(pwm_output_values));
|
||||
PX4_WARN("warning: trim values not valid - no mixer loaded");
|
||||
|
||||
} else {
|
||||
pwm->channel_count = _mixing_output.mixers()->get_trims((int16_t *)pwm->values);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case PWM_SERVO_GET_COUNT:
|
||||
PX4_DEBUG("PWM_SERVO_GET_COUNT");
|
||||
*(unsigned *)arg = _max_actuators;
|
||||
|
||||
Reference in New Issue
Block a user