forked from Archive/PX4-Autopilot
Merge pull request #2210 from mcharleb/qurt-test
Sensors: added missing px4_close and removed _exit() call
This commit is contained in:
commit
be58ced1b2
|
@ -922,16 +922,16 @@ Sensors::gyro_init()
|
||||||
warnx("FATAL: no gyro found: %s", GYRO0_DEVICE_PATH);
|
warnx("FATAL: no gyro found: %s", GYRO0_DEVICE_PATH);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
/* set the gyro internal sampling rate to default rate */
|
|
||||||
px4_ioctl(fd, GYROIOCSSAMPLERATE, GYRO_SAMPLERATE_DEFAULT);
|
|
||||||
|
|
||||||
/* set the driver to poll at default rate */
|
|
||||||
px4_ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* set the gyro internal sampling rate to default rate */
|
||||||
|
px4_ioctl(fd, GYROIOCSSAMPLERATE, GYRO_SAMPLERATE_DEFAULT);
|
||||||
|
|
||||||
|
/* set the driver to poll at default rate */
|
||||||
|
px4_ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT);
|
||||||
|
|
||||||
|
px4_close(fd);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2086,8 +2086,12 @@ Sensors::task_main()
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
warnx("Sensor initialization failed");
|
||||||
_sensors_task = -1;
|
_sensors_task = -1;
|
||||||
_exit(ret);
|
if (_fd_adc >=0) {
|
||||||
|
close(_fd_adc);
|
||||||
|
_fd_adc = -1;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue