From b0acac0f55306ead66d65ce33bebee18ac2cc7bc Mon Sep 17 00:00:00 2001 From: "pierre-louis.k" Date: Fri, 3 Aug 2018 16:41:45 +0200 Subject: [PATCH] AP_RangeFinder: Clean TeraRanger driver --- libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp index f17c642435..1f95bdc899 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_TeraRangerI2C.cpp @@ -110,11 +110,10 @@ bool AP_RangeFinder_TeraRangerI2C::measure() return dev->transfer(&cmd, 1, nullptr, 0); } -// collect - return last value measured by sensor +// collect_raw() - return last value measured by sensor bool AP_RangeFinder_TeraRangerI2C::collect_raw(uint16_t &raw_distance) { uint8_t d[3]; - uint16_t distance = 0; // Take range reading if (!dev->transfer(nullptr, 0, d, sizeof(d))) { @@ -135,11 +134,11 @@ bool AP_RangeFinder_TeraRangerI2C::check_measure(uint16_t raw_distance, uint16_t { // Check for error codes if (raw_distance == 0xFFFF) { - // too far away + // Too far away return false; } if (raw_distance == 0x0000) { - // too close + // Too close return false; } if (raw_distance == 0x0001) {