diff --git a/makefiles/stdio.inc.mk b/makefiles/stdio.inc.mk index 7d75fa7083..2813329544 100644 --- a/makefiles/stdio.inc.mk +++ b/makefiles/stdio.inc.mk @@ -20,7 +20,7 @@ ifneq (,$(filter stdio_cdc_acm,$(USEMODULE))) endif ifneq (,$(filter stdio_rtt,$(USEMODULE))) - USEMODULE += xtimer + USEMODULE += ztimer_msec endif ifneq (,$(filter stdio_ethos,$(USEMODULE))) diff --git a/sys/stdio_rtt/stdio_rtt.c b/sys/stdio_rtt/stdio_rtt.c index fe846eb615..ba1705d01a 100644 --- a/sys/stdio_rtt/stdio_rtt.c +++ b/sys/stdio_rtt/stdio_rtt.c @@ -79,7 +79,7 @@ #include "stdio_rtt.h" #include "thread.h" #include "mutex.h" -#include "xtimer.h" +#include "ztimer.h" #if MODULE_VFS #include "vfs.h" @@ -88,7 +88,7 @@ /* This parameter affects the bandwidth of both input and output. Decreasing it will significantly improve bandwidth at the cost of CPU time. */ #ifndef STDIO_POLL_INTERVAL -#define STDIO_POLL_INTERVAL 50000U +#define STDIO_POLL_INTERVAL 50U #endif #define MIN(a, b) (((a) < (b)) ? (a) : (b)) @@ -315,9 +315,9 @@ ssize_t stdio_read(void* buffer, size_t count) { /* We only unlock when rtt_stdio_enable_stdin is called Note that we assume only one caller invoked this function */ } - xtimer_ticks32_t last_wakeup = xtimer_now(); + uint32_t last_wakeup = ztimer_now(ZTIMER_MSEC); while(1) { - xtimer_periodic_wakeup(&last_wakeup, STDIO_POLL_INTERVAL); + ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup, STDIO_POLL_INTERVAL); res = rtt_read(buffer, count); if (res > 0) return res; @@ -329,9 +329,9 @@ ssize_t stdio_read(void* buffer, size_t count) { ssize_t stdio_write(const void* in, size_t len) { const char *buffer = (const char *)in; int written = rtt_write(buffer, (unsigned)len); - xtimer_ticks32_t last_wakeup = xtimer_now(); + uint32_t last_wakeup = ztimer_now(ZTIMER_MSEC); while (blocking_stdout && ((size_t)written < len)) { - xtimer_periodic_wakeup(&last_wakeup, STDIO_POLL_INTERVAL); + ztimer_periodic_wakeup(ZTIMER_MSEC, &last_wakeup, STDIO_POLL_INTERVAL); written += rtt_write(&buffer[written], len-written); } return (ssize_t)written;