diff options
author | Keith Packard <keithp@keithp.com> | 2014-10-25 10:17:48 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-10-25 10:17:48 -0700 |
commit | 9102183b40f0b32d4fb6d24502b79a6431184310 (patch) | |
tree | b82ba4a1bb7ca7dc578f248a5389c5fcd0ac0f9d /src | |
parent | cb83b5432e1320726ad496ded78cced7274618b0 (diff) |
altos: Sort out ao_gps_print altitude fetching
ao_gps_print is used by both teledongle/telebt and the host-based GPS
test code. The first instance uses the old internal GPS structure,
containing just a 16-bit altitude while the second uses an
ao_telemetry structure, which contains 32 bits split into two
members.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/ao_gps_print.c | 6 | ||||
-rw-r--r-- | src/test/ao_gps_test_ublox.c | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/kernel/ao_gps_print.c b/src/kernel/ao_gps_print.c index d26021da..6d9ee346 100644 --- a/src/kernel/ao_gps_print.c +++ b/src/kernel/ao_gps_print.c @@ -20,8 +20,8 @@ #endif #include "ao_telem.h" -#ifndef AO_TELEMETRY_LOCATION_ALTITUDE -#define AO_TELEMETRY_LOCATION_ALTITUDE(l) ((l)->altitude) +#ifndef AO_GPS_ORIG_ALTITUDE +#define AO_GPS_ORIG_ALTITUDE(l) ((l)->altitude) #endif void @@ -46,7 +46,7 @@ ao_gps_print(__xdata struct ao_gps_orig *gps_data) __reentrant AO_TELEM_GPS_ALTITUDE " %d ", (long) gps_data->latitude, (long) gps_data->longitude, - AO_TELEMETRY_LOCATION_ALTITUDE(gps_data)); + AO_GPS_ORIG_ALTITUDE(gps_data)); if (gps_data->flags & AO_GPS_DATE_VALID) printf(AO_TELEM_GPS_YEAR " %d " diff --git a/src/test/ao_gps_test_ublox.c b/src/test/ao_gps_test_ublox.c index 5ea205d6..83efbb4f 100644 --- a/src/test/ao_gps_test_ublox.c +++ b/src/test/ao_gps_test_ublox.c @@ -59,6 +59,7 @@ struct ao_telemetry_location { typedef int32_t gps_alt_t; #define AO_TELEMETRY_LOCATION_ALTITUDE(l) (((gps_alt_t) (l)->altitude_high << 16) | ((l)->altitude_low)) +#define AO_GPS_ORIG_ALTITUDE(l) AO_TELEMETRY_LOCATION_ALTITUDE(l) #define AO_TELEMETRY_LOCATION_SET_ALTITUDE(l,a) (((l)->altitude_high = (a) >> 16), \ ((l)->altitude_low = (a))) |