diff options
author | root <root@lab.panaceas.james.local> | 2019-02-19 19:47:19 +0000 |
---|---|---|
committer | root <root@lab.panaceas.james.local> | 2019-02-19 19:47:19 +0000 |
commit | 379b0ec3e5eacdde822966c84062bea41da7ae89 (patch) | |
tree | a126770df052c3e735cdf09a32e5d58593c3c4ec /app/gps.c | |
parent | 9bbf1d200534cd946c4776e29457f989147b45b2 (diff) | |
download | clock-379b0ec3e5eacdde822966c84062bea41da7ae89.tar.gz clock-379b0ec3e5eacdde822966c84062bea41da7ae89.tar.bz2 clock-379b0ec3e5eacdde822966c84062bea41da7ae89.zip |
Working
Diffstat (limited to 'app/gps.c')
-rw-r--r-- | app/gps.c | 37 |
1 files changed, 21 insertions, 16 deletions
@@ -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); |