mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:33:34 +08:00
Fix cut and paste so that we send direct PWM and read back servo values from the right pages.
This commit is contained in:
@@ -985,7 +985,7 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
/* send a direct PWM value */
|
/* send a direct PWM value */
|
||||||
ret = io_reg_set(PX4IO_PAGE_SERVOS, channel, arg);
|
ret = io_reg_set(PX4IO_PAGE_DIRECT_PWM, channel, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -999,7 +999,7 @@ PX4IO::ioctl(file *filep, int cmd, unsigned long arg)
|
|||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
/* fetch a current PWM value */
|
/* fetch a current PWM value */
|
||||||
uint32_t value = io_reg_get(PX4IO_PAGE_DIRECT_PWM, channel);
|
uint32_t value = io_reg_get(PX4IO_PAGE_SERVOS, channel);
|
||||||
if (value == _io_reg_get_error) {
|
if (value == _io_reg_get_error) {
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user