aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/ll40ls
diff options
context:
space:
mode:
authorakdslr <allyson.kreft@dslrpros.com>2014-06-05 09:53:56 -0400
committerLorenz Meier <lm@inf.ethz.ch>2014-07-08 12:03:40 +0200
commit67b7a858881229b95483e986a6e4d90ab34ac257 (patch)
tree2ec2688e8ada3490c49117d266ee63c367d705b0 /src/drivers/ll40ls
parent7f91f0cc3ef806a7959e06ab16d4094bcfe871bd (diff)
downloadpx4-firmware-67b7a858881229b95483e986a6e4d90ab34ac257.tar.gz
px4-firmware-67b7a858881229b95483e986a6e4d90ab34ac257.tar.bz2
px4-firmware-67b7a858881229b95483e986a6e4d90ab34ac257.zip
LL40LS driver: Changes from the May 4th plane test flight
Diffstat (limited to 'src/drivers/ll40ls')
-rw-r--r--src/drivers/ll40ls/ll40ls.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/drivers/ll40ls/ll40ls.cpp b/src/drivers/ll40ls/ll40ls.cpp
index 287207837..bc012e2e9 100644
--- a/src/drivers/ll40ls/ll40ls.cpp
+++ b/src/drivers/ll40ls/ll40ls.cpp
@@ -86,7 +86,7 @@
#define LL40LS_MIN_DISTANCE (0.00f)
#define LL40LS_MAX_DISTANCE (14.00f)
-#define LL40LS_CONVERSION_INTERVAL 60000 /* 60ms */
+#define LL40LS_CONVERSION_INTERVAL 100000 /* 100ms */
/* oddly, ERROR is not defined for c++ */
#ifdef ERROR
@@ -517,8 +517,8 @@ LL40LS::collect()
return ret;
}
- uint16_t distance = val[0] << 8 | val[1];
- float si_units = (distance * 1.0f) / 100.0f; /* cm to m */
+ uint16_t distance = (val[0] << 8) | val[1];
+ float si_units = distance * 0.01f; /* cm to m */
struct range_finder_report report;
/* this should be fairly close to the end of the measurement, so the best approximation of the time */
@@ -532,8 +532,10 @@ LL40LS::collect()
report.valid = 0;
}
- /* publish it */
- orb_publish(ORB_ID(sensor_range_finder), _range_finder_topic, &report);
+ /* publish it, if we are the primary */
+ if (_range_finder_topic >= 0) {
+ orb_publish(ORB_ID(sensor_range_finder), _range_finder_topic, &report);
+ }
if (_reports->force(&report)) {
perf_count(_buffer_overflows);