mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17165 from leandrolanzieri/pr/sys/ztimer_kconfig_entry
sys/ztimer: rework Kconfig To eliminate circular dependencies based in periph_rtc and xtimer_ztimer_compatibility the following changes are applied: - Change entrypoint of ztimer as a specific backend is always required - Add a non-module symbol for ztimer_usec that bring in the ztimer and ztimer_usec module which allows the xtimer ztimer compatibility layer to only select the ztimer_usec module preventing circular dependency issues
This commit is contained in:
commit
da60ba5fff
@ -9,4 +9,4 @@ CONFIG_MODULE_SHELL=y
|
||||
CONFIG_MODULE_PS=y
|
||||
CONFIG_MODULE_SHELL_COMMANDS=y
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
menuconfig MODULE_XTIMER
|
||||
bool "xtimer"
|
||||
depends on HAS_PERIPH_TIMER || MODULE_XTIMER_ON_ZTIMER || MODULE_ZTIMER_XTIMER_COMPAT
|
||||
depends on HAS_PERIPH_TIMER
|
||||
depends on TEST_KCONFIG
|
||||
|
||||
# use timer peripheral unless ztimer compatibility module is used
|
||||
|
@ -5,15 +5,7 @@
|
||||
# directory for more details.
|
||||
#
|
||||
|
||||
menuconfig MODULE_ZTIMER
|
||||
bool "ztimer - High level timer abstraction layer"
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_ZTIMER_CORE
|
||||
select MODULE_ZTIMER_CONVERT_FRAC
|
||||
select MODULE_ZTIMER_CONVERT_SHIFT
|
||||
select MODULE_ZTIMER_EXTEND
|
||||
|
||||
if MODULE_ZTIMER
|
||||
menu "ztimer - High level timer abstraction layer"
|
||||
|
||||
config ZTIMER_CUSTOM_BACKEND_CONFIGURATION
|
||||
bool "Override default backend selection"
|
||||
@ -45,12 +37,21 @@ endmenu # Backends
|
||||
|
||||
menu "Clocks"
|
||||
|
||||
config MODULE_ZTIMER_USEC
|
||||
# TODO: this extra indirection in the entry point for ztimer_usec is required
|
||||
# to allow xtimer compatibility modules to depend on ztimer being there while
|
||||
# still selecting ztimer_usec.
|
||||
config ZTIMER_USEC
|
||||
bool "Microseconds"
|
||||
select MODULE_ZTIMER_USEC
|
||||
select MODULE_ZTIMER
|
||||
|
||||
config MODULE_ZTIMER_USEC
|
||||
bool
|
||||
select MODULE_ZTIMER_PERIPH_TIMER
|
||||
|
||||
config MODULE_ZTIMER_MSEC
|
||||
bool "Milliseconds"
|
||||
select MODULE_ZTIMER
|
||||
|
||||
choice
|
||||
bool "Backend"
|
||||
@ -70,6 +71,7 @@ endchoice
|
||||
|
||||
config MODULE_ZTIMER_SEC
|
||||
bool "Seconds"
|
||||
select MODULE_ZTIMER
|
||||
|
||||
choice
|
||||
bool "Backend"
|
||||
@ -95,6 +97,7 @@ endchoice
|
||||
endmenu # Clocks
|
||||
|
||||
menu "Frequency conversion"
|
||||
depends on MODULE_ZTIMER
|
||||
|
||||
config MODULE_ZTIMER_CONVERT_MULDIV64
|
||||
bool "64-bits arithmetic conversion"
|
||||
@ -132,15 +135,16 @@ menu "xtimer and evtimer compatibility"
|
||||
|
||||
choice
|
||||
bool "xtimer compatibility"
|
||||
optional
|
||||
depends on MODULE_ZTIMER_USEC
|
||||
depends on MODULE_XTIMER && MODULE_ZTIMER
|
||||
|
||||
config MODULE_XTIMER_ON_ZTIMER
|
||||
bool "ztimer_usec as timer backend for xtimer"
|
||||
select MODULE_ZTIMER_USEC
|
||||
|
||||
config MODULE_ZTIMER_XTIMER_COMPAT
|
||||
bool "map xtimer calls to ztimer"
|
||||
select MODULE_DIV
|
||||
select MODULE_ZTIMER_USEC
|
||||
help
|
||||
This is a wrapper of xtimer API on ztimer_usec and is currently
|
||||
incomplete. Unless doing testing, use xtimer on ztimer.
|
||||
@ -157,6 +161,15 @@ config MODULE_EVTIMER_ON_ZTIMER
|
||||
|
||||
endmenu # xtimer compatibility
|
||||
|
||||
config MODULE_ZTIMER
|
||||
bool
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_ZTIMER_CORE
|
||||
select MODULE_ZTIMER_CONVERT_FRAC
|
||||
select MODULE_ZTIMER_CONVERT_SHIFT
|
||||
select MODULE_ZTIMER_EXTEND
|
||||
|
||||
if MODULE_ZTIMER
|
||||
|
||||
# TODO: only use MODULE_ZTIMER_AUTO_INIT, for now we try to get the same modules
|
||||
# as the Makefile dependency resolution. See sys/ztimer/Makefile.dep for more
|
||||
@ -191,3 +204,5 @@ config MODULE_ZTIMER_EXTEND
|
||||
bool
|
||||
|
||||
endif # MODULE_ZTIMER
|
||||
|
||||
endmenu
|
||||
|
@ -2,5 +2,5 @@
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_SM_PWM_01C=y
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_PROGRESS_BAR=y
|
||||
|
@ -1,5 +1,5 @@
|
||||
CONFIG_MODULE_POSIX_SLEEP=y
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_ZTIMER_MSEC=y
|
||||
CONFIG_PACKAGE_UMORSE=y
|
||||
|
@ -1,4 +1,4 @@
|
||||
CONFIG_MODULE_POSIX_SLEEP=y
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_ZTIMER_MSEC=y
|
||||
|
@ -1,4 +1,4 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
|
@ -1,4 +1,4 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
|
@ -1,5 +1,5 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_ZTIMER_OVERHEAD=y
|
||||
|
@ -1,7 +1,7 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_ZTIMER_MSEC=y
|
||||
|
||||
CONFIG_MODULE_FMT=y
|
||||
|
@ -1,5 +1,5 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_SHELL=y
|
||||
|
@ -1,4 +1,4 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
|
@ -1,7 +1,6 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_ZTIMER=y
|
||||
CONFIG_MODULE_ZTIMER_PERIPH_TIMER=y
|
||||
CONFIG_MODULE_ZTIMER_USEC=y
|
||||
CONFIG_ZTIMER_USEC=y
|
||||
CONFIG_MODULE_ZTIMER_MSEC=y
|
||||
CONFIG_MODULE_ZTIMER_SEC=y
|
||||
|
Loading…
Reference in New Issue
Block a user