1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/xtimer: prefer ztimer_xtimer_compat

This commit is contained in:
Francisco Molina 2022-03-16 09:34:25 +01:00
parent 0b1453667e
commit 9260cfb4f0
3 changed files with 13 additions and 18 deletions

View File

@ -1,11 +1,11 @@
# Include this for boards whose timer periph cannot generate a clock frequency
# suitable for xtimer with the available clock sources and dividers.
# This will use ztimer to perform the required frequency conversion.
# By default, xtimer is still used with ztimer as backed, unless
# ztimer_xtimer_compat is used.
# By default, ztimer_xtimer_compat is used unless xtimer_on_ztimer is
# selected.
ifneq (,$(filter xtimer,$(USEMODULE)))
ifeq (,$(filter ztimer_xtimer_compat ztimer64_xtimer_compat,$(USEMODULE)))
USEMODULE += xtimer_on_ztimer
ifeq (,$(filter xtimer_on_ztimer,$(USEMODULE)))
USEMODULE += ztimer_xtimer_compat
endif
endif

View File

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

View File

@ -143,23 +143,18 @@ choice
bool "xtimer compatibility"
depends on MODULE_XTIMER && MODULE_ZTIMER
config MODULE_XTIMER_ON_ZTIMER
bool "ztimer_usec as timer backend for xtimer"
select MODULE_ZTIMER_USEC
select MODULE_ZTIMER_PERIPH_TIMER
config MODULE_ZTIMER_XTIMER_COMPAT
bool "map xtimer calls to ztimer"
select MODULE_DIV
select MODULE_ZTIMER_USEC
select MODULE_ZTIMER_PERIPH_TIMER
help
This is a wrapper of xtimer API on ztimer_usec and is currently
incomplete. Unless doing testing, use xtimer on ztimer.
comment "The ztimer xtimer compatibility module is incomplete, consider using MODULE_ZTIMER64_XTIMER_COMPAT instead."
depends on MODULE_ZTIMER_XTIMER_COMPAT
This is a wrapper of xtimer API on ztimer_usec.
config MODULE_XTIMER_ON_ZTIMER
bool "ztimer_usec as timer backend for xtimer"
select MODULE_ZTIMER_USEC
select MODULE_ZTIMER_PERIPH_TIMER
endchoice
config MODULE_ZTIMER64_XTIMER_COMPAT