Merge pull request #2236 from TSC21/drivers_cleanup

drivers: added validity check
This commit is contained in:
Lorenz Meier
2015-06-26 07:39:09 +02:00
4 changed files with 18 additions and 4 deletions
+4 -2
View File
@@ -854,7 +854,7 @@ test()
}
warnx("single read");
warnx("val: %0.2f m", (double)report.current_distance);
warnx("measurement: %0.2f m", (double)report.current_distance);
warnx("time: %llu", report.timestamp);
/* start the sensor polling at 2 Hz rate */
@@ -885,7 +885,9 @@ test()
}
warnx("read #%u", i);
warnx("val: %0.3f m", (double)report.current_distance);
warnx("valid %u", (float)report.current_distance > report.min_distance
&& (float)report.current_distance < report.max_distance ? 1 : 0);
warnx("measurement: %0.3f m", (double)report.current_distance);
warnx("time: %llu", report.timestamp);
}