From 379b0ec3e5eacdde822966c84062bea41da7ae89 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 19 Feb 2019 19:47:19 +0000 Subject: Working --- app/gps.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'app/gps.c') diff --git a/app/gps.c b/app/gps.c index b0bc433..7e2fd1b 100644 --- a/app/gps.c +++ b/app/gps.c @@ -185,25 +185,30 @@ ubx_recv_utc (uint8_t *ptr, unsigned len) ptr += ubx_get_u8 (ptr, &min); ptr += ubx_get_u8 (ptr, &sec); -// printf ("gps %02d:%02d:%02d %09d\r\n", (int) hour, (int) min, (int) sec, (int) nano); + // printf ("gps %02d:%02d:%02d %09d\r\n", (int) hour, (int) min, (int) sec, (int) nano); -{ - UTC u; - EPOCH gps_time; + { + UTC u; + EPOCH gps_time; + uint32_t now; + uint64_t abs; - u.jday = 0; - u.year = year; - u.month = month; - u.mday = day; - u.hour = hour; - u.minute = min; - u.second = sec; - u.nanosecond = 0; + u.jday = 0; + u.year = year; + u.month = month; + u.mday = day; + u.hour = hour; + u.minute = min; + u.second = sec; + u.nanosecond = 0; - gps_time = time_utc_to_epoch (u); + gps_time = time_utc_to_epoch (u); - pll_set_offset (gps_time, abs); -} + + now = SCS_DWT_CYCCNT; + abs = abs_extend (now); + pll_set_offset (gps_time, abs); + } #if 0 @@ -437,7 +442,7 @@ static void gps_pps_dispatch (void) if (!v) return; - abs=abs_extend(now); + abs = abs_extend (now); -- cgit v1.2.3