diff --git a/sys/Makefile.dep b/sys/Makefile.dep index a2343939419f..ade4c6521604 100644 --- a/sys/Makefile.dep +++ b/sys/Makefile.dep @@ -99,7 +99,7 @@ endif ifneq (,$(filter csma_sender,$(USEMODULE))) USEMODULE += random - USEMODULE += xtimer + USEMODULE += xztimer_fallback endif ifneq (,$(filter dhcpv6_%,$(USEMODULE))) @@ -167,7 +167,7 @@ endif ifneq (,$(filter uhcpc,$(USEMODULE))) USEMODULE += posix_inet - USEMODULE += xtimer + USEMODULE += xztimer_fallback endif ifneq (,$(filter netdev_tap,$(USEMODULE))) @@ -274,7 +274,6 @@ ifneq (,$(filter posix_sockets,$(USEMODULE))) USEMODULE += random USEMODULE += vfs USEMODULE += posix_headers - USEMODULE += xtimer endif ifneq (,$(filter shell,$(USEMODULE))) @@ -818,7 +817,7 @@ endif ifneq (,$(filter suit_transport_coap, $(USEMODULE))) USEMODULE += nanocoap_sock - USEMODULE += xtimer + USEMODULE += xztimer_fallback USEMODULE += sock_util endif @@ -858,6 +857,13 @@ ifneq (,$(filter evtimer,$(USEMODULE))) endif endif +ifneq (,$(filter xztimer_fallback,$(USEMODULE))) + USEMODULE := $(filter-out xztimer_fallback,$(USEMODULE)) + ifeq (,$(filter ztimer_usec,$(USEMODULE))) + USEMODULE += xtimer + endif +endif + # handle xtimer's deps. Needs to be done *after* ztimer ifneq (,$(filter xtimer,$(USEMODULE))) include $(RIOTBASE)/sys/xtimer/Makefile.dep diff --git a/sys/net/application_layer/uhcp/uhcpc.c b/sys/net/application_layer/uhcp/uhcpc.c index 1dccdfb3f3b8..9b9d914a370f 100644 --- a/sys/net/application_layer/uhcp/uhcpc.c +++ b/sys/net/application_layer/uhcp/uhcpc.c @@ -12,7 +12,11 @@ #include "net/af.h" #include "net/sock/udp.h" #include "net/uhcp.h" +#if IS_USED(MODULE_ZTIMER_USEC) +#include "ztimer/xtimer_compat.h" +#else #include "xtimer.h" +#endif /** * @brief Request prefix from uhcp server diff --git a/sys/net/link_layer/csma_sender/csma_sender.c b/sys/net/link_layer/csma_sender/csma_sender.c index da95dafd266c..0bb280c78fbd 100644 --- a/sys/net/link_layer/csma_sender/csma_sender.c +++ b/sys/net/link_layer/csma_sender/csma_sender.c @@ -22,8 +22,13 @@ #include #include #include +#include +#if IS_USED(MODULE_ZTIMER_USEC) +#include "ztimer/xtimer_compat.h" +#else #include "xtimer.h" +#endif #include "random.h" #include "net/netdev.h" #include "net/netopt.h" diff --git a/sys/suit/transport/coap.c b/sys/suit/transport/coap.c index a3a7edf9daf1..4b0ca6b6adde 100644 --- a/sys/suit/transport/coap.c +++ b/sys/suit/transport/coap.c @@ -32,7 +32,11 @@ #include "net/nanocoap_sock.h" #include "thread.h" #include "periph/pm.h" +#if IS_USED(MODULE_ZTIMER_USEC) +#include "ztimer/xtimer_compat.h" +#else #include "xtimer.h" +#endif #include "suit/transport/coap.h" #include "net/sock/util.h"