From ba5f6406a8b8380066acfb8b77a24955433b7287 Mon Sep 17 00:00:00 2001 From: Leon Schuermann Date: Mon, 27 Jan 2025 10:09:32 -0500 Subject: [PATCH] examples/tap_network: switch to new libtock alarm APIs --- examples/tap_network/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/tap_network/main.c b/examples/tap_network/main.c index 04f6ec95d..db1e17e0f 100644 --- a/examples/tap_network/main.c +++ b/examples/tap_network/main.c @@ -1,9 +1,10 @@ /* vim: set sw=2 expandtab tw=80: */ -#include #include #include -#include + +#include +#include #include #include @@ -54,9 +55,9 @@ void sys_arch_unprotect(__attribute__((unused)) sys_prot_t pval) {} // Provide a reference to the current time in milliseconds, such that LwIP can // timeout TCP connections properly, etc. uint32_t sys_now(void) { - uint32_t now; - alarm_internal_read(&now); - return now; + struct timeval tv; + libtock_alarm_gettimeasticks(&tv); + return (tv.tv_usec / 1000) + (tv.tv_sec * 1000); } // A received, but not yet processed LwIP packet. This is written in the packet