summaryrefslogtreecommitdiff
path: root/driver_ubx.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2010-04-18 21:23:42 -0700
committerGary E. Miller <gem@rellim.com>2010-04-18 21:23:42 -0700
commit0e7ff3dcd0e44e9b0b556e1770cc55e6ac723d68 (patch)
treeb9c4ce369c11e4b91714e1c3cd582e38fbae6ad6 /driver_ubx.c
parent948770e120fe7028ed0f65c539b9dda129ee2a31 (diff)
downloadgpsd-0e7ff3dcd0e44e9b0b556e1770cc55e6ac723d68.tar.gz
Eliminate a lot of private copies of gps_tow for one global copy in
sesion->context.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r--driver_ubx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/driver_ubx.c b/driver_ubx.c
index 0bb61958..127f410f 100644
--- a/driver_ubx.c
+++ b/driver_ubx.c
@@ -73,9 +73,11 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf,
tow = (unsigned int)getleul(buf, 0);
gw = (unsigned short)getlesw(buf, 8);
session->context->gps_week = gw;
+ session->context->gps_tow = tow / 1000.0;
- t = gpstime_to_unix((int)session->context->gps_week,
- tow / 1000.0) - session->context->leap_seconds;
+ t = gpstime_to_unix((int)session->context->gps_week,
+ session->context->gps_tow)
+ - session->context->leap_seconds;
session->newdata.time = t;
mask |= TIME_IS;
}
@@ -179,8 +181,10 @@ ubx_msg_nav_timegps(struct gps_device_t *session, unsigned char *buf,
if ((flags & 0x7) != 0)
session->context->leap_seconds = (int)getub(buf, 10);
+ session->context->gps_tow = tow / 1000.0;
t = gpstime_to_unix((int)session->context->gps_week,
- tow / 1000.0) - session->context->leap_seconds;
+ session->context->gps_tow)
+ - session->context->leap_seconds;
session->newdata.time = t;
gpsd_report(LOG_DATA, "TIMEGPS: time=%.2f mask={TIME}\n",