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:
jwilson
2016-02-05 19:33:37 -08:00
committed by Julian Oes
parent e26cca760a
commit b31472af0c
3 changed files with 27 additions and 7 deletions
+5 -2
View File
@@ -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