mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
AP_GPS: removed duplicate print_latlon()
This commit is contained in:
parent
ce3ee97e73
commit
c3abdaf308
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user