|
|
|
@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
|
|
|
|
|
FastSerialPort0(Serial); |
|
|
|
|
FastSerialPort1(Serial1); |
|
|
|
|
|
|
|
|
|
GPS *gps; |
|
|
|
|
GPS *gps; |
|
|
|
|
AP_GPS_Auto GPS(&Serial1, &gps); |
|
|
|
|
|
|
|
|
|
#define T6 1000000 |
|
|
|
@ -21,19 +21,19 @@ AP_GPS_Auto GPS(&Serial1, &gps);
@@ -21,19 +21,19 @@ AP_GPS_Auto GPS(&Serial1, &gps);
|
|
|
|
|
// probably this should be moved to AP_Common |
|
|
|
|
void print_latlon(BetterStream *s, int32_t lat_or_lon) |
|
|
|
|
{ |
|
|
|
|
int32_t dec_portion, frac_portion; |
|
|
|
|
int32_t abs_lat_or_lon = labs(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) |
|
|
|
|
// extract decimal portion (special handling of negative numbers to ensure we round towards zero) |
|
|
|
|
dec_portion = abs_lat_or_lon / T7; |
|
|
|
|
|
|
|
|
|
// extract fractional portion |
|
|
|
|
// 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("-")); |
|
|
|
|
} |
|
|
|
|
// 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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -62,7 +62,7 @@ void loop()
@@ -62,7 +62,7 @@ void loop()
|
|
|
|
|
(int)gps->ground_course / 100, |
|
|
|
|
gps->num_sats, |
|
|
|
|
gps->time, |
|
|
|
|
gps->status()); |
|
|
|
|
gps->status()); |
|
|
|
|
} else { |
|
|
|
|
Serial.println("No fix"); |
|
|
|
|
} |
|
|
|
|