sys/ztimer: add dependencies for ztimer_sec

This commit is contained in:
Leandro Lanzieri 2021-09-29 09:19:38 +02:00
parent 5a9c659f5d
commit 34259e1e29
No known key found for this signature in database
GPG Key ID: F4E9A721761C7593

View File

@ -108,3 +108,27 @@ ifneq (,$(filter ztimer_msec,$(USEMODULE)))
USEMODULE += ztimer_periph_timer
endif
endif
ifneq (,$(filter ztimer_sec,$(USEMODULE)))
USEMODULE += ztimer
# try to use RTC unless we are on native, as it is based on xtimer it is
# actually buggy
ifeq (,$(filter native,$(BOARD)))
FEATURES_OPTIONAL += periph_rtc
endif
# HACK: see above
include $(RIOTMAKE)/features_check.inc.mk
ifneq (,$(filter periph_rtc,$(FEATURES_USED)))
USEMODULE += ztimer_periph_rtc
else
# if there is no RTC try to use RTT
FEATURES_OPTIONAL += periph_rtt
# HACK: see above
include $(RIOTMAKE)/features_check.inc.mk
ifneq (,$(filter periph_rtt,$(FEATURES_USED)))
USEMODULE += ztimer_periph_rtt
else
USEMODULE += ztimer_periph_timer
endif
endif
endif