From 0548136a4c886830414fb575d9d0daa7f1a7d170 Mon Sep 17 00:00:00 2001 From: fishsoupisgood Date: Wed, 8 May 2019 23:17:01 +0100 Subject: sysclk back to 168MHz, 10Mhz -> TIM2 --- app/ntp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/ntp.c') diff --git a/app/ntp.c b/app/ntp.c index f8ca357..0bdda4d 100644 --- a/app/ntp.c +++ b/app/ntp.c @@ -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)); -- cgit v1.2.3