ztimer: pull ztimer_periph_rtt for ZTIMER_MSEC if available
This commit is contained in:
parent
0c06948373
commit
c80390f28b
@ -133,10 +133,8 @@ ifneq (,$(filter test_utils_result_output,$(USEMODULE)))
|
|||||||
include $(RIOTBASE)/sys/test_utils/result_output/Makefile.include
|
include $(RIOTBASE)/sys/test_utils/result_output/Makefile.include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Convert xtimer into a pseudo module if its API is already implemented by
|
ifneq (,$(filter ztimer,$(USEMODULE)))
|
||||||
# ztimer's compatibility wrapper
|
include $(RIOTBASE)/sys/ztimer/Makefile.include
|
||||||
ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
|
|
||||||
PSEUDOMODULES += xtimer
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter prng,$(USEMODULE)))
|
ifneq (,$(filter prng,$(USEMODULE)))
|
||||||
|
|||||||
@ -15,7 +15,11 @@ menuconfig MODULE_ZTIMER
|
|||||||
|
|
||||||
if MODULE_ZTIMER
|
if MODULE_ZTIMER
|
||||||
|
|
||||||
|
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
||||||
|
bool "Override default backend selection"
|
||||||
|
|
||||||
menu "Backends"
|
menu "Backends"
|
||||||
|
visible if ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
||||||
|
|
||||||
config MODULE_ZTIMER_PERIPH_RTC
|
config MODULE_ZTIMER_PERIPH_RTC
|
||||||
bool "RTC peripheral"
|
bool "RTC peripheral"
|
||||||
@ -26,7 +30,6 @@ config MODULE_ZTIMER_PERIPH_RTT
|
|||||||
bool "RTT peripheral"
|
bool "RTT peripheral"
|
||||||
depends on HAS_PERIPH_RTT
|
depends on HAS_PERIPH_RTT
|
||||||
select MODULE_PERIPH_RTT
|
select MODULE_PERIPH_RTT
|
||||||
default y if !MODULE_ZTIMER_PERIPH_TIMER
|
|
||||||
|
|
||||||
config MODULE_ZTIMER_PERIPH_PTP
|
config MODULE_ZTIMER_PERIPH_PTP
|
||||||
bool "PTP peripheral"
|
bool "PTP peripheral"
|
||||||
@ -37,7 +40,6 @@ config MODULE_ZTIMER_PERIPH_TIMER
|
|||||||
bool "Timer peripheral"
|
bool "Timer peripheral"
|
||||||
depends on HAS_PERIPH_TIMER
|
depends on HAS_PERIPH_TIMER
|
||||||
select MODULE_PERIPH_TIMER
|
select MODULE_PERIPH_TIMER
|
||||||
default y
|
|
||||||
|
|
||||||
endmenu # Backends
|
endmenu # Backends
|
||||||
|
|
||||||
@ -45,19 +47,57 @@ menu "Clocks"
|
|||||||
|
|
||||||
config MODULE_ZTIMER_USEC
|
config MODULE_ZTIMER_USEC
|
||||||
bool "Microseconds"
|
bool "Microseconds"
|
||||||
depends on MODULE_ZTIMER_PERIPH_TIMER
|
select MODULE_ZTIMER_PERIPH_TIMER
|
||||||
|
|
||||||
config MODULE_ZTIMER_MSEC
|
config MODULE_ZTIMER_MSEC
|
||||||
bool "Milliseconds"
|
bool "Milliseconds"
|
||||||
depends on MODULE_ZTIMER_PERIPH_TIMER || MODULE_ZTIMER_PERIPH_RTT
|
|
||||||
|
choice
|
||||||
|
bool "Backend"
|
||||||
|
depends on MODULE_ZTIMER_MSEC
|
||||||
|
default ZTIMER_MSEC_BACKEND_RTT
|
||||||
|
|
||||||
|
config ZTIMER_MSEC_BACKEND_TIMER
|
||||||
|
bool "Timer"
|
||||||
|
select MODULE_ZTIMER_PERIPH_TIMER
|
||||||
|
|
||||||
|
config ZTIMER_MSEC_BACKEND_RTT
|
||||||
|
bool "RTT"
|
||||||
|
depends on HAS_PERIPH_RTT
|
||||||
|
select MODULE_ZTIMER_PERIPH_RTT
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
config MODULE_ZTIMER_SEC
|
config MODULE_ZTIMER_SEC
|
||||||
bool "Seconds"
|
bool "Seconds"
|
||||||
depends on MODULE_ZTIMER_PERIPH_TIMER || MODULE_ZTIMER_PERIPH_RTT || MODULE_ZTIMER_PERIPH_RTC
|
|
||||||
|
choice
|
||||||
|
bool "Backend"
|
||||||
|
depends on MODULE_ZTIMER_SEC
|
||||||
|
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
|
||||||
|
!CPU_COMMON_SAM0 && \
|
||||||
|
!CPU_COMMON_EFM32 && \
|
||||||
|
!CPU_COMMON_STM32F1
|
||||||
|
default ZTIMER_SEC_BACKEND_RTT
|
||||||
|
|
||||||
|
config ZTIMER_SEC_BACKEND_TIMER
|
||||||
|
bool "Timer"
|
||||||
|
select MODULE_ZTIMER_PERIPH_TIMER
|
||||||
|
|
||||||
|
config ZTIMER_SEC_BACKEND_RTT
|
||||||
|
bool "RTT"
|
||||||
|
depends on HAS_PERIPH_RTT
|
||||||
|
select MODULE_ZTIMER_PERIPH_RTT
|
||||||
|
|
||||||
|
config ZTIMER_SEC_BACKEND_RTC
|
||||||
|
bool "RTC"
|
||||||
|
depends on HAS_PERIPH_RTC
|
||||||
|
select MODULE_ZTIMER_PERIPH_RTC
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
endmenu # Clocks
|
endmenu # Clocks
|
||||||
|
|
||||||
|
|
||||||
menu "Frequency conversion"
|
menu "Frequency conversion"
|
||||||
|
|
||||||
config MODULE_ZTIMER_CONVERT_MULDIV64
|
config MODULE_ZTIMER_CONVERT_MULDIV64
|
||||||
|
|||||||
@ -89,4 +89,22 @@ endif
|
|||||||
|
|
||||||
ifneq (,$(filter ztimer_msec,$(USEMODULE)))
|
ifneq (,$(filter ztimer_msec,$(USEMODULE)))
|
||||||
USEMODULE += ztimer
|
USEMODULE += ztimer
|
||||||
|
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
|
||||||
endif
|
endif
|
||||||
|
|||||||
15
sys/ztimer/Makefile.include
Normal file
15
sys/ztimer/Makefile.include
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# Convert xtimer into a pseudo module if its API is already implemented by
|
||||||
|
# ztimer's compatibility wrapper
|
||||||
|
ifneq (,$(filter ztimer_xtimer_compat,$(USEMODULE)))
|
||||||
|
PSEUDOMODULES += xtimer
|
||||||
|
endif
|
||||||
|
|
||||||
|
# By defaul use highest possible RTT_FREQUENCY for platforms that allow it. This
|
||||||
|
# might not be the most optimized for conversion guarantees that ztimer_periph_rtt
|
||||||
|
# will have a capable backend.
|
||||||
|
ifneq (,$(filter ztimer_periph_rtt,$(USEMODULE)))
|
||||||
|
ifneq (,$(filter stm32 nrf52 sam% kinetis efm32,$(CPU)))
|
||||||
|
RTT_FREQUENCY ?= RTT_MAX_FREQUENCY
|
||||||
|
CFLAGS += -DRTT_FREQUENCY=$(RTT_FREQUENCY)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
2
tests/pkg_umorse/Makefile.ci
Normal file
2
tests/pkg_umorse/Makefile.ci
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
BOARD_INSUFFICIENT_MEMORY := \
|
||||||
|
nucleo-l011k4 \
|
||||||
2
tests/ztimer_periodic/Makefile.ci
Normal file
2
tests/ztimer_periodic/Makefile.ci
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
BOARD_INSUFFICIENT_MEMORY := \
|
||||||
|
nucleo-l011k4 \
|
||||||
Loading…
x
Reference in New Issue
Block a user