drivers: added validity check

This commit is contained in:
TSC21
2015-05-26 18:05:26 +01:00
parent f13510e8a6
commit 79e084a154
3 changed files with 14 additions and 2 deletions
+4
View File
@@ -832,6 +832,7 @@ test()
}
warnx("single read");
warnx("measurement: %0.2f m", (double)report.current_distance);
warnx("time: %llu", report.timestamp);
/* start the sensor polling at 2Hz */
@@ -860,6 +861,9 @@ test()
}
warnx("periodic read %u", i);
warnx("valid %u", (float)report.current_distance > report.min_distance
&& (float)report.current_distance < report.max_distance ? 1 : 0);
warnx("measurement: %0.3f", (double)report.current_distance);
warnx("time: %llu", report.timestamp);
}