AP_GPS: removed duplicate print_latlon()

This commit is contained in:
Andrew Tridgell 2013-04-20 13:57:59 +10:00
parent ce3ee97e73
commit c3abdaf308

View File

@ -24,26 +24,6 @@ AP_GPS_Auto GPS(&gps);
#define T6 1000000
#define T7 10000000
// print_latlon - prints an latitude or longitude value held in an int32_t
// probably this should be moved to AP_Common
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 / T7;
// extract fractional portion
frac_portion = abs_lat_or_lon - dec_portion*T7;
// print output including the minus sign
if( lat_or_lon < 0 ) {
s->printf_P(PSTR("-"));
}
s->printf_P(PSTR("%ld.%07ld"),(long)dec_portion,(long)frac_portion);
}
void setup()
{
hal.uartB->begin(38400);