2020-02-20 11:51:06 +01:00
|
|
|
#
|
|
|
|
# ztimer dependencies
|
|
|
|
#
|
|
|
|
|
|
|
|
# "ztimer" is the default meta-module of ztimer
|
|
|
|
ifneq (,$(filter ztimer,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_core
|
|
|
|
USEMODULE += ztimer_convert_frac
|
|
|
|
USEMODULE += ztimer_convert_shift
|
2021-11-24 12:32:24 +01:00
|
|
|
DEFAULT_MODULE += auto_init_ztimer
|
|
|
|
DEFAULT_MODULE += ztimer_init
|
2020-02-20 11:51:06 +01:00
|
|
|
endif
|
|
|
|
|
2021-12-15 11:22:11 +01:00
|
|
|
ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_usec
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(filter ztimer64_xtimer_compat,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer64_usec
|
|
|
|
USEMODULE += ztimer_xtimer_compat
|
|
|
|
endif
|
|
|
|
|
2020-02-20 11:51:06 +01:00
|
|
|
ifneq (,$(filter ztimer_%,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_core
|
|
|
|
USEMODULE += ztimer_extend
|
|
|
|
endif
|
|
|
|
|
2022-02-02 18:56:49 +01:00
|
|
|
ifneq (,$(filter ztimer_ondemand_%,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_ondemand
|
|
|
|
endif
|
|
|
|
|
2020-02-20 11:51:06 +01:00
|
|
|
ifneq (,$(filter ztimer_convert_%,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_convert
|
|
|
|
endif
|
|
|
|
|
2022-10-26 20:52:42 +02:00
|
|
|
ifneq (,$(filter ztimer_periph_lptimer,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer_periph_timer
|
|
|
|
endif
|
|
|
|
|
2020-02-20 15:33:24 +01:00
|
|
|
ifneq (,$(filter ztimer_periph_timer,$(USEMODULE)))
|
2020-02-20 11:51:06 +01:00
|
|
|
FEATURES_REQUIRED += periph_timer
|
|
|
|
endif
|
|
|
|
|
2021-01-07 10:22:56 +01:00
|
|
|
ifneq (,$(filter ztimer_periph_rtc,$(USEMODULE)))
|
|
|
|
FEATURES_REQUIRED += periph_rtc
|
|
|
|
endif
|
|
|
|
|
2020-02-20 15:33:24 +01:00
|
|
|
ifneq (,$(filter ztimer_periph_rtt,$(USEMODULE)))
|
2020-02-20 11:51:06 +01:00
|
|
|
FEATURES_REQUIRED += periph_rtt
|
|
|
|
endif
|
|
|
|
|
2021-01-20 08:39:59 +01:00
|
|
|
ifneq (,$(filter ztimer_periph_ptp,$(USEMODULE)))
|
|
|
|
FEATURES_REQUIRED += periph_ptp_timer
|
|
|
|
endif
|
|
|
|
|
2020-02-20 11:51:06 +01:00
|
|
|
ifneq (,$(filter ztimer_convert_frac,$(USEMODULE)))
|
|
|
|
USEMODULE += frac
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(filter ztimer_usec,$(USEMODULE)))
|
|
|
|
USEMODULE += ztimer
|
2020-02-20 15:33:24 +01:00
|
|
|
USEMODULE += ztimer_periph_timer
|
2020-02-20 11:51:06 +01:00
|
|
|
endif
|
|
|
|
|
2021-12-14 18:43:53 +01:00
|
|
|
# NOTE: select the module here and not in the CPU so that order of inclusion
|
|
|
|
# does not have periph_rtt selected earlier that it should be while at the same
|
|
|
|
# time avoiding the module 'ztimer-no_periph_rtt' being included unecesarily.
|
2022-03-10 14:07:37 +01:00
|
|
|
# The samd21 rtt busy loops for 180us every time an alarm is set or
|
2021-12-14 18:43:53 +01:00
|
|
|
# the counter is read, this propagates and leads to timing errors
|
|
|
|
# on ztimer_msec that are higher than > +-1msec.
|
|
|
|
# The same goes for the fe310 rtt.
|
2022-03-10 14:07:37 +01:00
|
|
|
ifneq (,$(filter samd21 fe310,$(CPU)))
|
2021-12-14 18:43:53 +01:00
|
|
|
USEMODULE += ztimer_no_periph_rtt
|
|
|
|
endif
|
|
|
|
|
2021-11-02 10:50:34 +01:00
|
|
|
ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE)))
|
2020-02-20 11:51:06 +01:00
|
|
|
USEMODULE += ztimer
|
2021-11-02 10:50:34 +01:00
|
|
|
ifeq (,$(filter ztimer_no_periph_rtt,$(USEMODULE)))
|
|
|
|
FEATURES_OPTIONAL += periph_rtt
|
|
|
|
# HACK: periph_rtt will get used only in the next iteration but an updated
|
|
|
|
# state for FEATURES_USED is needed here so include `features_check.inc.mk`
|
|
|
|
# here instead.
|
|
|
|
# An other option would be to check FEATURES_PROVIDED this would avoid the
|
|
|
|
# order of inclusion problem but it would no take into account possible conflicts
|
|
|
|
# and is also currently not allowed in the build system.
|
|
|
|
# An other alternative would be to delay to the next loop, but this produce a
|
|
|
|
# case where another loop is not executed and the conditional not evaluated
|
|
|
|
# If these kind of usecases pop up before Kconfig migration is completed
|
|
|
|
# then another alternative would be introduce a variable to require an extra
|
|
|
|
# loop independent of USEMODULE, FEATURES_REQUIRED and USEPKG
|
|
|
|
include $(RIOTMAKE)/features_check.inc.mk
|
|
|
|
ifneq (,$(filter periph_rtt,$(FEATURES_USED)))
|
|
|
|
USEMODULE += ztimer_periph_rtt
|
|
|
|
else
|
|
|
|
USEMODULE += ztimer_periph_timer
|
|
|
|
endif
|
2021-12-10 09:57:05 +01:00
|
|
|
else
|
|
|
|
USEMODULE += ztimer_periph_timer
|
2021-09-29 09:19:38 +02:00
|
|
|
endif
|
|
|
|
endif
|