1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/xtimer/Makefile.dep
Francisco Molina 0b1453667e sys/xtimer-ztimer: rework dependecies to ease backend switch
This adds a xtimer_no_ztimer_default that is currently always
selected in Makefile, but that can be switched off in Kconfig.
Removing its inclusion will allow switching the default xtimer
backend to ztimer, while allowing for an easy way back.
2022-03-17 14:37:40 +01:00

32 lines
1.0 KiB
Makefile

DEFAULT_MODULE += auto_init_xtimer
# In whatever combination of backends periph_timer will be required
# - xtimer (only) -> periph_timer
# - xtimer_on_ztimer -> ztimer_usec -> ztimer_periph_timer -> periph_timer
# - ztimer_xtimer_compat -> ztimer_usec -> ztimer_periph_timer -> periph_timer
# But requesting it here avoid an ifeq dependency that would be subject to
# dependency inclusion order issues
FEATURES_REQUIRED += periph_timer
USEMODULE += xtimer_no_ztimer_default
ifeq (,$(filter xtimer_no_ztimer_default,$(USEMODULE)))
ifeq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
USEMODULE += xtimer_on_ztimer
endif
else
ifneq (,$(filter ztimer,$(USEMODULE)))
ifeq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
USEMODULE += xtimer_on_ztimer
endif
endif
endif
ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
DISABLE_MODULE += auto_init_xtimer
USEMODULE += div
endif
# make xtimer use ztimer_usec as low level timer
ifneq (,$(filter xtimer_on_ztimer,$(USEMODULE)))
USEMODULE += ztimer_usec
endif