summaryrefslogtreecommitdiffstats
path: root/app/ntp.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-05-08 23:17:01 +0100
committerfishsoupisgood <github@madingley.org>2019-05-08 23:17:01 +0100
commit0548136a4c886830414fb575d9d0daa7f1a7d170 (patch)
tree29380a80a6ecae73d54a5d42990539494b71b871 /app/ntp.c
parentea0ef10070c1070dc66cb0d8689410722c06758e (diff)
downloadclock-0548136a4c886830414fb575d9d0daa7f1a7d170.tar.gz
clock-0548136a4c886830414fb575d9d0daa7f1a7d170.tar.bz2
clock-0548136a4c886830414fb575d9d0daa7f1a7d170.zip
sysclk back to 168MHz, 10Mhz -> TIM2old-master
Diffstat (limited to 'app/ntp.c')
-rw-r--r--app/ntp.c4
1 files changed, 2 insertions, 2 deletions
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));