From bf3fa8b99b91f333f9c7bcbabba2a658de89d308 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 10 Feb 2014 14:57:17 +0900 Subject: [PATCH] RangeFinder: remove raw_value from SharpGP2Y --- libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h b/libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h index 10841c74df..ab7fde8ebf 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h +++ b/libraries/AP_RangeFinder/AP_RangeFinder_SharpGP2Y.h @@ -10,11 +10,11 @@ class AP_RangeFinder_SharpGP2Y : public RangeFinder { public: AP_RangeFinder_SharpGP2Y(AP_HAL::AnalogSource *source, FilterInt16 *filter); - int convert_raw_to_distance(int _raw_value) { - if( _raw_value == 0 ) { + int16_t convert_raw_to_distance(int16_t raw_value) { + if (raw_value == 0) { return max_distance; } else { - return 14500/_raw_value; + return 14500/raw_value; } } // read value from analog port and return distance in cm