mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
20e68fbb68
With this commit xtimer will always be implemented with ztimer. The default compat layer will be ztimer_xtimer_compat, so xtimer calls will be inlined to ZTIMER_USEC, or ZTIMER64_USEC when the 64bit xtimer API is required. This can be reverted by adding 'xtimer_no_ztimer_default' module to a build.
31 lines
999 B
Makefile
31 lines
999 B
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
|
|
|
|
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
|