aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Gagne <don@thegagnes.com>2015-03-23 19:00:25 -0700
committerLorenz Meier <lm@inf.ethz.ch>2015-03-28 13:09:07 -0700
commit07853fbb5807ff54762b662485f1735af399b625 (patch)
treed77769d09cd10e6df31e77ad7bfc2d5645b3b87d
parenta098ca4ec68b8737243d8e7aab5bdb2db4d842a1 (diff)
downloadpx4-firmware-07853fbb5807ff54762b662485f1735af399b625.tar.gz
px4-firmware-07853fbb5807ff54762b662485f1735af399b625.tar.bz2
px4-firmware-07853fbb5807ff54762b662485f1735af399b625.zip
Fixed warnx messages to show correct sensor #
-rw-r--r--src/modules/sensors/sensors.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp
index 3b93393d2..259361be6 100644
--- a/src/modules/sensors/sensors.cpp
+++ b/src/modules/sensors/sensors.cpp
@@ -145,7 +145,7 @@
#endif
static const int ERROR = -1;
-#define CAL_FAILED_APPLY_CAL_MSG "FAILED APPLYING SENSOR CAL"
+#define CAL_FAILED_APPLY_CAL_MSG "FAILED APPLYING %s CAL #%u"
/**
* Sensor app start / stop handling function
@@ -1382,12 +1382,12 @@ Sensors::parameter_update_poll(bool forced)
failed = failed || (OK != param_get(param_find(str), &gscale.z_scale));
if (failed) {
- warnx("%s: gyro #%u", CAL_FAILED_APPLY_CAL_MSG, gyro_count);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "gyro", i);
} else {
/* apply new scaling and offsets */
res = ioctl(fd, GYROIOCSSCALE, (long unsigned int)&gscale);
if (res) {
- warnx(CAL_FAILED_APPLY_CAL_MSG);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "gyro", i);
} else {
gyro_count++;
config_ok = true;
@@ -1449,12 +1449,12 @@ Sensors::parameter_update_poll(bool forced)
failed = failed || (OK != param_get(param_find(str), &gscale.z_scale));
if (failed) {
- warnx("%s: acc #%u", CAL_FAILED_APPLY_CAL_MSG, accel_count);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "accel", i);
} else {
/* apply new scaling and offsets */
res = ioctl(fd, ACCELIOCSSCALE, (long unsigned int)&gscale);
if (res) {
- warnx(CAL_FAILED_APPLY_CAL_MSG);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "accel", i);
} else {
accel_count++;
config_ok = true;
@@ -1566,12 +1566,12 @@ Sensors::parameter_update_poll(bool forced)
}
if (failed) {
- warnx("%s: mag #%u", CAL_FAILED_APPLY_CAL_MSG, mag_count);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "mag", i);
} else {
/* apply new scaling and offsets */
res = ioctl(fd, MAGIOCSSCALE, (long unsigned int)&gscale);
if (res) {
- warnx(CAL_FAILED_APPLY_CAL_MSG);
+ warnx(CAL_FAILED_APPLY_CAL_MSG, "mag", i);
} else {
mag_count++;
config_ok = true;