From 431bd77d7e0189f0d4ebb9951ddc10698225efca Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 23 Mar 2019 13:48:00 +1100 Subject: [PATCH] AP_Math: move print_latlon into sole caller --- libraries/AP_Math/location.cpp | 21 --------------------- libraries/AP_Math/location.h | 5 ----- 2 files changed, 26 deletions(-) diff --git a/libraries/AP_Math/location.cpp b/libraries/AP_Math/location.cpp index 365761bcf1..b4a5cfc18b 100644 --- a/libraries/AP_Math/location.cpp +++ b/libraries/AP_Math/location.cpp @@ -156,27 +156,6 @@ bool location_sanitize(const struct Location &defaultLoc, struct Location &loc) return has_changed; } -/* - print a int32_t lat/long in decimal degrees - */ -void print_latlon(AP_HAL::BetterStream *s, int32_t lat_or_lon) -{ - int32_t dec_portion, frac_portion; - int32_t abs_lat_or_lon = labs(lat_or_lon); - - // extract decimal portion (special handling of negative numbers to ensure we round towards zero) - dec_portion = abs_lat_or_lon / 10000000UL; - - // extract fractional portion - frac_portion = abs_lat_or_lon - dec_portion*10000000UL; - - // print output including the minus sign - if( lat_or_lon < 0 ) { - s->printf("-"); - } - s->printf("%ld.%07ld",(long)dec_portion,(long)frac_portion); -} - // return true when lat and lng are within range bool check_lat(float lat) { diff --git a/libraries/AP_Math/location.h b/libraries/AP_Math/location.h index e28ff9e889..738855b32b 100644 --- a/libraries/AP_Math/location.h +++ b/libraries/AP_Math/location.h @@ -69,11 +69,6 @@ bool locations_are_same(const struct Location &loc1, const struct Locatio */ bool location_sanitize(const struct Location &defaultLoc, struct Location &loc); -/* - print a int32_t lat/long in decimal degrees - */ -void print_latlon(AP_HAL::BetterStream *s, int32_t lat_or_lon); - // Converts from WGS84 geodetic coordinates (lat, lon, height) // into WGS84 Earth Centered, Earth Fixed (ECEF) coordinates // (X, Y, Z)