Merge pull request #2210 from mcharleb/qurt-test

Sensors: added missing px4_close and removed _exit() call
This commit is contained in:
Lorenz Meier 2015-05-21 19:46:06 +02:00
commit be58ced1b2
1 changed files with 13 additions and 9 deletions

View File

@ -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;
} }