From 13a7aaf1d775dfacea6a588210be393853ed38d4 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Thu, 2 Dec 2021 10:30:21 +0100 Subject: [PATCH] sys/trace: migrate to ztimer --- sys/Makefile.dep | 3 ++- sys/trace/trace.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/Makefile.dep b/sys/Makefile.dep index 0f811f58b5..34373bce9b 100644 --- a/sys/Makefile.dep +++ b/sys/Makefile.dep @@ -73,7 +73,8 @@ ifneq (,$(filter rtt_cmd,$(USEMODULE))) endif ifneq (,$(filter trace,$(USEMODULE))) - USEMODULE += xtimer + USEMODULE += ztimer + USEMODULE += ztimer_usec endif ifneq (,$(filter ssp,$(USEMODULE))) diff --git a/sys/trace/trace.c b/sys/trace/trace.c index e898fb23eb..c4ad2c7500 100644 --- a/sys/trace/trace.c +++ b/sys/trace/trace.c @@ -23,7 +23,7 @@ #include #include "irq.h" -#include "xtimer.h" +#include "ztimer.h" #ifndef CONFIG_TRACE_BUFSIZE #define CONFIG_TRACE_BUFSIZE 512 @@ -42,7 +42,7 @@ void trace(uint32_t val) unsigned state = irq_disable(); tracebuf[tracebuf_pos % CONFIG_TRACE_BUFSIZE] = - (tracebuf_entry_t){ .time = xtimer_now_usec(), .val = val }; + (tracebuf_entry_t){ .time = ztimer_now(ZTIMER_USEC), .val = val }; tracebuf_pos++; irq_restore(state); }