[PX4IO/PWM driver] Fixed a bug in px4io driver

This commit is contained in:
Bartosz Wawrzacz 2016-10-23 13:28:23 +02:00 committed by Lorenz Meier
parent 82bfaf3967
commit bb52a77194

View File

@ -2726,12 +2726,15 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
break;
}
case PWM_SERVO_GET_TRIM_PWM:
case PWM_SERVO_GET_TRIM_PWM: {
struct pwm_output_values *pwm = (struct pwm_output_values *)arg;
pwm->channel_count = _max_actuators;
ret = io_reg_get(PX4IO_PAGE_CONTROL_TRIM_PWM, 0, (uint16_t *)arg, _max_actuators);
ret = io_reg_get(PX4IO_PAGE_CONTROL_TRIM_PWM, 0, pwm->values, _max_actuators);
if (ret != OK) {
ret = -EIO;
if (ret != OK) {
ret = -EIO;
}
}
break;