1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/trace: migrate to ztimer

This commit is contained in:
Alexandre Abadie 2021-12-02 10:30:21 +01:00
parent f9f95534f6
commit 13a7aaf1d7
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 4 additions and 3 deletions

View File

@ -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)))

View File

@ -23,7 +23,7 @@
#include <stdio.h>
#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);
}