From f68523b39bb1a85daf3e6ac9c11a626fc1f4496b Mon Sep 17 00:00:00 2001 From: rmackay9 Date: Mon, 12 Nov 2012 10:40:19 +0900 Subject: [PATCH] AP_RangeFinder_MaxsonarI2CXL: resolve shadowed variable compiler warning --- libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp | 7 ++++--- libraries/AP_RangeFinder/RangeFinder.h | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp index fb8756d89e..ca6f4de470 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_MaxsonarI2CXL.cpp @@ -23,6 +23,7 @@ // AVR LibC Includes #include +#include // Arduino I2C lib #include "AP_RangeFinder_MaxsonarI2CXL.h" // Constructor ////////////////////////////////////////////////////////////// @@ -55,16 +56,16 @@ bool AP_RangeFinder_MaxsonarI2CXL::take_reading() int AP_RangeFinder_MaxsonarI2CXL::read() { uint8_t buff[2]; - int16_t distance = 0; + int16_t ret_value = 0; // take range reading and read back results if (I2c.read(_addr, 2, buff) != 0) { healthy = false; }else{ // combine results into distance - distance = buff[0] << 8 | buff[1]; + ret_value = buff[0] << 8 | buff[1]; healthy = true; } - return distance; + return ret_value; } \ No newline at end of file diff --git a/libraries/AP_RangeFinder/RangeFinder.h b/libraries/AP_RangeFinder/RangeFinder.h index 740d5d5c0d..96ab12f1bc 100644 --- a/libraries/AP_RangeFinder/RangeFinder.h +++ b/libraries/AP_RangeFinder/RangeFinder.h @@ -1,10 +1,9 @@ #ifndef RangeFinder_h #define RangeFinder_h -#include -#include -#include "../AP_AnalogSource/AP_AnalogSource.h" -#include "../Filter/Filter.h" // Filter library +#include +#include +#include // Filter library /* * #define AP_RANGEFINDER_ORIENTATION_FRONT 0, 10, 0