mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 03:53:33 +08:00
sensors: do not exit task on error
This commit is contained in:
@@ -143,6 +143,12 @@
|
|||||||
|
|
||||||
#define STICK_ON_OFF_LIMIT 0.75f
|
#define STICK_ON_OFF_LIMIT 0.75f
|
||||||
|
|
||||||
|
/* oddly, ERROR is not defined for c++ */
|
||||||
|
#ifdef ERROR
|
||||||
|
# undef ERROR
|
||||||
|
#endif
|
||||||
|
static const int ERROR = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sensor app start / stop handling function
|
* Sensor app start / stop handling function
|
||||||
*
|
*
|
||||||
@@ -466,12 +472,6 @@ private:
|
|||||||
namespace sensors
|
namespace sensors
|
||||||
{
|
{
|
||||||
|
|
||||||
/* oddly, ERROR is not defined for c++ */
|
|
||||||
#ifdef ERROR
|
|
||||||
# undef ERROR
|
|
||||||
#endif
|
|
||||||
static const int ERROR = -1;
|
|
||||||
|
|
||||||
Sensors *g_sensors = nullptr;
|
Sensors *g_sensors = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -860,7 +860,9 @@ Sensors::parameters_update()
|
|||||||
warnx("qnh ioctl, %lu", (unsigned long)(_parameters.baro_qnh * 100));
|
warnx("qnh ioctl, %lu", (unsigned long)(_parameters.baro_qnh * 100));
|
||||||
int ret = ioctl(fd, BAROIOCSMSLPRESSURE, (unsigned long)(_parameters.baro_qnh * 100));
|
int ret = ioctl(fd, BAROIOCSMSLPRESSURE, (unsigned long)(_parameters.baro_qnh * 100));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
errx(ret, "qnh could not be set");
|
warnx("qnh could not be set");
|
||||||
|
close(fd);
|
||||||
|
return ERROR;
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user