mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 03:11:36 +08:00
Airspeed sim: Fix reset function
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013, 2014 PX4 Development Team. All rights reserved.
|
* Copyright (c) 2013, 2014, 2017 PX4 Development Team. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @file meas_airspeed_sim.cpp
|
* @file meas_airspeed_sim.cpp
|
||||||
* @author Lorenz Meier
|
* @author Lorenz Meier <lorenz@px4.io>
|
||||||
* @author Sarthak Kaingade
|
* @author Sarthak Kaingade
|
||||||
* @author Simon Wilks
|
* @author Simon Wilks
|
||||||
* @author Thomas Gubler
|
* @author Thomas Gubler
|
||||||
@@ -473,14 +473,18 @@ reset()
|
|||||||
|
|
||||||
if (ioctl(fd, SENSORIOCRESET, 0) < 0) {
|
if (ioctl(fd, SENSORIOCRESET, 0) < 0) {
|
||||||
PX4_ERR("driver reset failed");
|
PX4_ERR("driver reset failed");
|
||||||
|
close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
|
||||||
PX4_ERR("driver poll restart failed");
|
PX4_ERR("driver poll restart failed");
|
||||||
|
close(fd);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user