aboutsummaryrefslogtreecommitdiff
path: root/src/modules/sensors/sensors.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-08-17 15:21:27 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-08-17 15:21:50 +0200
commit86ae2e489fdd3656faa38202f44e4b53342e450b (patch)
treeda1a65456e7ef38087bcd3361c4b8e78965a01f4 /src/modules/sensors/sensors.cpp
parent91d8cb2edcda1fde3c1765a659b2445592ed03f1 (diff)
downloadpx4-firmware-86ae2e489fdd3656faa38202f44e4b53342e450b.tar.gz
px4-firmware-86ae2e489fdd3656faa38202f44e4b53342e450b.tar.bz2
px4-firmware-86ae2e489fdd3656faa38202f44e4b53342e450b.zip
sensors: do not exit task on error
Diffstat (limited to 'src/modules/sensors/sensors.cpp')
-rw-r--r--src/modules/sensors/sensors.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp
index 0d51667d0..aac297ef8 100644
--- a/src/modules/sensors/sensors.cpp
+++ b/src/modules/sensors/sensors.cpp
@@ -143,6 +143,12 @@
#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
*
@@ -466,12 +472,6 @@ private:
namespace sensors
{
-/* oddly, ERROR is not defined for c++ */
-#ifdef ERROR
-# undef ERROR
-#endif
-static const int ERROR = -1;
-
Sensors *g_sensors = nullptr;
}
@@ -860,7 +860,9 @@ Sensors::parameters_update()
warnx("qnh ioctl, %lu", (unsigned long)(_parameters.baro_qnh * 100));
int ret = ioctl(fd, BAROIOCSMSLPRESSURE, (unsigned long)(_parameters.baro_qnh * 100));
if (ret) {
- errx(ret, "qnh could not be set");
+ warnx("qnh could not be set");
+ close(fd);
+ return ERROR;
}
close(fd);
}