2022-03-16 08:57:56 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
ifeq (,$(filter xtimer_no_ztimer_default,$(USEMODULE)))
|
2022-03-16 09:34:25 +01:00
|
|
|
ifeq (,$(filter xtimer_on_ztimer,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_xtimer_compat
|
2022-03-01 11:59:29 +01:00
|
|
|
endif
|
|
|
|
else
|
2022-03-16 08:57:56 +01:00
|
|
|
ifneq (,$(filter ztimer,$(USEMODULE)))
|
2022-03-16 09:34:25 +01:00
|
|
|
ifeq (,$(filter xtimer_on_ztimer,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_xtimer_compat
|
2022-03-16 08:57:56 +01:00
|
|
|
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
|
2022-03-01 11:59:29 +01:00
|
|
|
endif
|