mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-06 01:30:35 +08:00
Cherry-picked i22438c8
Original description: Modified the sensor module to prevent the selection of an invalid secondary/tertiary gyro if the primary gyro times out
This commit is contained in:
@@ -230,19 +230,19 @@ extern "C" {
|
||||
|
||||
int px4_ioctl(int fd, int cmd, unsigned long arg)
|
||||
{
|
||||
PX4_DEBUG("px4_ioctl fd = %d", fd);
|
||||
int ret = 0;
|
||||
|
||||
VDev *dev = get_vdev(fd);
|
||||
|
||||
if (dev) {
|
||||
ret = dev->ioctl(filemap[fd], cmd, arg);
|
||||
|
||||
} else {
|
||||
PX4_ERR("px4_ioctl: vdev handle not available, file handle: %d", fd);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
PX4_ERR("px4_ioctl: call failed: %d", ret);
|
||||
px4_errno = -ret;
|
||||
}
|
||||
|
||||
@@ -305,6 +305,9 @@ extern "C" {
|
||||
fd_pollable = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
PX4_DEBUG("vdev invalid, index: %d, name: %s, handle: 0x%X", i, thread_name, fds[i].fd);
|
||||
}
|
||||
}
|
||||
|
||||
// If any FD can be polled, lock the semaphore and
|
||||
|
||||
Reference in New Issue
Block a user