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))) ifeq (,$(filter xtimer_on_ztimer,$(USEMODULE))) USEMODULE += ztimer_xtimer_compat endif else ifneq (,$(filter ztimer,$(USEMODULE))) ifeq (,$(filter xtimer_on_ztimer,$(USEMODULE))) USEMODULE += ztimer_xtimer_compat 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