projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Switch all tick variables to AO_TICK_TYPE/AO_TICK_SIGNED
[fw/altos]
/
src
/
drivers
/
ao_gps_ublox.c
diff --git
a/src/drivers/ao_gps_ublox.c
b/src/drivers/ao_gps_ublox.c
index a6d930835baed49a70d619073b84349242b0a806..2556d314547b08cd91a2a3971bf0166a7697a5ff 100644
(file)
--- a/
src/drivers/ao_gps_ublox.c
+++ b/
src/drivers/ao_gps_ublox.c
@@
-28,7
+28,7
@@
uint8_t ao_gps_new;
uint8_t ao_gps_mutex;
uint8_t ao_gps_new;
uint8_t ao_gps_mutex;
-
uint16_t
ao_gps_tick;
+
AO_TICK_TYPE
ao_gps_tick;
struct ao_telemetry_location ao_gps_data;
struct ao_telemetry_satellite ao_gps_tracking_data;
struct ao_telemetry_location ao_gps_data;
struct ao_telemetry_satellite ao_gps_tracking_data;
@@
-615,6
+615,8
@@
ao_gps(void)
uint8_t class, id;
struct ao_ublox_cksum cksum;
uint8_t i;
uint8_t class, id;
struct ao_ublox_cksum cksum;
uint8_t i;
+ AO_TICK_TYPE packet_start_tick;
+ AO_TICK_TYPE solution_tick = 0;
ao_gps_setup();
ao_gps_setup();
@@
-645,6
+647,8
@@
ao_gps(void)
/* Locate the begining of the next record */
while (ao_ublox_byte() != (uint8_t) 0xb5)
;
/* Locate the begining of the next record */
while (ao_ublox_byte() != (uint8_t) 0xb5)
;
+ packet_start_tick = ao_tick_count;
+
if (ao_ublox_byte() != (uint8_t) 0x62)
continue;
if (ao_ublox_byte() != (uint8_t) 0x62)
continue;
@@
-657,7
+661,7
@@
ao_gps(void)
ao_ublox_len = header_byte();
ao_ublox_len |= header_byte() << 8;
ao_ublox_len = header_byte();
ao_ublox_len |= header_byte() << 8;
- ao_gps_dbg(DBG_PROTO, "
class %02x id %02x len %d\n"
, class, id, ao_ublox_len);
+ ao_gps_dbg(DBG_PROTO, "
%6u class %02x id %02x len %d\n", packet_start_tick
, class, id, ao_ublox_len);
if (ao_ublox_len > 1023)
continue;
if (ao_ublox_len > 1023)
continue;
@@
-679,6
+683,7
@@
ao_gps(void)
if (ao_ublox_len != 52)
break;
ao_ublox_parse_nav_sol();
if (ao_ublox_len != 52)
break;
ao_ublox_parse_nav_sol();
+ solution_tick = packet_start_tick;
break;
case UBLOX_NAV_SVINFO:
if (ao_ublox_len < 8)
break;
case UBLOX_NAV_SVINFO:
if (ao_ublox_len < 8)
@@
-715,7
+720,7
@@
ao_gps(void)
switch (id) {
case UBLOX_NAV_TIMEUTC:
ao_mutex_get(&ao_gps_mutex);
switch (id) {
case UBLOX_NAV_TIMEUTC:
ao_mutex_get(&ao_gps_mutex);
- ao_gps_tick =
ao_time()
;
+ ao_gps_tick =
solution_tick
;
ao_gps_data.flags = 0;
ao_gps_data.flags |= AO_GPS_RUNNING;
ao_gps_data.flags = 0;
ao_gps_data.flags |= AO_GPS_RUNNING;