diff options
author | Keith Packard <keithp@keithp.com> | 2014-07-10 17:07:48 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-07-10 17:35:44 -0700 |
commit | 34d5be68ca23e8beb05db9a480faef63ecc911d0 (patch) | |
tree | bcf27108a1680f6c081f583f25b831fc192ac256 /src/test/ao_flight_test.c | |
parent | 0d044af0c5025a63026d05adcab68f265f179668 (diff) |
altos: Extend GPS altitudes to at least 24 bits everywhere
Telemetry gets a special 'mode' flag indicating that 24-bit data is
present; log files get new data and log readers are expected to detect
that via the firmware version number.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/test/ao_flight_test.c')
-rw-r--r-- | src/test/ao_flight_test.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/ao_flight_test.c b/src/test/ao_flight_test.c index 1ab22e5b..314998c1 100644 --- a/src/test/ao_flight_test.c +++ b/src/test/ao_flight_test.c @@ -175,7 +175,7 @@ ao_gps_angle(void) ao_gps_static.latitude / 1e7, ao_gps_static.longitude / 1e7, &dist, &bearing); - height = ao_gps_static.altitude - ao_gps_prev.altitude; + height = AO_TELEMETRY_LOCATION_ALTITUDE(&ao_gps_static) - AO_TELEMETRY_LOCATION_ALTITUDE(&ao_gps_prev); angle = atan2(dist, height); return angle * 180/M_PI; @@ -756,7 +756,10 @@ ao_sleep(void *wchan) ao_gps_static.tick = tick; ao_gps_static.latitude = int32(bytes, 0); ao_gps_static.longitude = int32(bytes, 4); - ao_gps_static.altitude = int32(bytes, 8); + { + int32_t altitude = int32(bytes, 8); + AO_TELEMETRY_LOCATION_SET_ALTITUDE(&ao_gps_static, altitude); + } ao_gps_static.flags = bytes[13]; if (!ao_gps_count) ao_gps_first = ao_gps_static; |