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,7 +922,7 @@ Sensors::gyro_init()
|
|||
warnx("FATAL: no gyro found: %s", GYRO0_DEVICE_PATH);
|
||||
return ERROR;
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
/* set the gyro internal sampling rate to default rate */
|
||||
px4_ioctl(fd, GYROIOCSSAMPLERATE, GYRO_SAMPLERATE_DEFAULT);
|
||||
|
@ -930,7 +930,7 @@ Sensors::gyro_init()
|
|||
/* set the driver to poll at default rate */
|
||||
px4_ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT);
|
||||
|
||||
}
|
||||
px4_close(fd);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
@ -2086,8 +2086,12 @@ Sensors::task_main()
|
|||
} while (0);
|
||||
|
||||
if (ret) {
|
||||
warnx("Sensor initialization failed");
|
||||
_sensors_task = -1;
|
||||
_exit(ret);
|
||||
if (_fd_adc >=0) {
|
||||
close(_fd_adc);
|
||||
_fd_adc = -1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue