diff options
author | fishsoupisgood <github@madingley.org> | 2019-05-08 23:17:01 +0100 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2019-05-08 23:17:01 +0100 |
commit | 0548136a4c886830414fb575d9d0daa7f1a7d170 (patch) | |
tree | 29380a80a6ecae73d54a5d42990539494b71b871 /app/ntp.c | |
parent | ea0ef10070c1070dc66cb0d8689410722c06758e (diff) | |
download | clock-old-master.tar.gz clock-old-master.tar.bz2 clock-old-master.zip |
sysclk back to 168MHz, 10Mhz -> TIM2old-master
Diffstat (limited to 'app/ntp.c')
-rw-r--r-- | app/ntp.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -69,7 +69,7 @@ static uint64_t ntp_ts (uint64_t v) static void ntp_rx (void *arg, struct udp_pcb *s, struct pbuf *p, struct ip_addr *src_addr, u16_t port) { - uint32_t now = SCS_DWT_CYCCNT; + uint32_t now = HW_CLOCK_REG; struct ip_addr dst_addr = *src_addr; ntp_packet_t pkt; @@ -102,7 +102,7 @@ static void ntp_rx (void *arg, struct udp_pcb *s, struct pbuf *p, struct ip_addr pkt.receive_ts = ntp_ts (abs_extend (now)); pkt.reference_ts = ntp_ts (pll_last_update); - now = SCS_DWT_CYCCNT; + now = HW_CLOCK_REG; pkt.transmit_ts = ntp_ts (abs_extend (now)); memcpy (p->payload, &pkt, sizeof (ntp_packet_t)); |