Skip to content

Commit 34259e1

Browse files
sys/ztimer: add dependencies for ztimer_sec
1 parent 5a9c659 commit 34259e1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

sys/ztimer/Makefile.dep

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,27 @@ ifneq (,$(filter ztimer_msec,$(USEMODULE)))
108108
USEMODULE += ztimer_periph_timer
109109
endif
110110
endif
111+
112+
ifneq (,$(filter ztimer_sec,$(USEMODULE)))
113+
USEMODULE += ztimer
114+
# try to use RTC unless we are on native, as it is based on xtimer it is
115+
# actually buggy
116+
ifeq (,$(filter native,$(BOARD)))
117+
FEATURES_OPTIONAL += periph_rtc
118+
endif
119+
# HACK: see above
120+
include $(RIOTMAKE)/features_check.inc.mk
121+
ifneq (,$(filter periph_rtc,$(FEATURES_USED)))
122+
USEMODULE += ztimer_periph_rtc
123+
else
124+
# if there is no RTC try to use RTT
125+
FEATURES_OPTIONAL += periph_rtt
126+
# HACK: see above
127+
include $(RIOTMAKE)/features_check.inc.mk
128+
ifneq (,$(filter periph_rtt,$(FEATURES_USED)))
129+
USEMODULE += ztimer_periph_rtt
130+
else
131+
USEMODULE += ztimer_periph_timer
132+
endif
133+
endif
134+
endif

0 commit comments

Comments
 (0)