diff --git a/examples/twr_aloha/app.config.test b/examples/twr_aloha/app.config.test index ada0fffae1..47383cda5d 100644 --- a/examples/twr_aloha/app.config.test +++ b/examples/twr_aloha/app.config.test @@ -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 diff --git a/sys/ztimer/Kconfig b/sys/ztimer/Kconfig index a9d159f50f..daad9f11b1 100644 --- a/sys/ztimer/Kconfig +++ b/sys/ztimer/Kconfig @@ -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,7 +135,7 @@ menu "xtimer and evtimer compatibility" choice bool "xtimer compatibility" - depends on MODULE_XTIMER + depends on MODULE_XTIMER && MODULE_ZTIMER config MODULE_XTIMER_ON_ZTIMER bool "ztimer_usec as timer backend for xtimer" @@ -158,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 @@ -192,3 +204,5 @@ config MODULE_ZTIMER_EXTEND bool endif # MODULE_ZTIMER + +endmenu diff --git a/tests/driver_sm_pwm_01c/app.config.test b/tests/driver_sm_pwm_01c/app.config.test index b91916cc53..d7d48bd0b2 100644 --- a/tests/driver_sm_pwm_01c/app.config.test +++ b/tests/driver_sm_pwm_01c/app.config.test @@ -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 diff --git a/tests/pkg_umorse/app.config.test b/tests/pkg_umorse/app.config.test index 3ce870d695..0080d6d2d6 100644 --- a/tests/pkg_umorse/app.config.test +++ b/tests/pkg_umorse/app.config.test @@ -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 diff --git a/tests/posix_sleep/app.config.test b/tests/posix_sleep/app.config.test index adcda0cec0..1400000f78 100644 --- a/tests/posix_sleep/app.config.test +++ b/tests/posix_sleep/app.config.test @@ -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 diff --git a/tests/ztimer_msg/app.config.test b/tests/ztimer_msg/app.config.test index 733646e663..2fc4266478 100644 --- a/tests/ztimer_msg/app.config.test +++ b/tests/ztimer_msg/app.config.test @@ -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 diff --git a/tests/ztimer_mutex_lock_timeout/app.config.test b/tests/ztimer_mutex_lock_timeout/app.config.test index 733646e663..2fc4266478 100644 --- a/tests/ztimer_mutex_lock_timeout/app.config.test +++ b/tests/ztimer_mutex_lock_timeout/app.config.test @@ -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 diff --git a/tests/ztimer_overhead/app.config.test b/tests/ztimer_overhead/app.config.test index 7819e81c5d..1245a93667 100644 --- a/tests/ztimer_overhead/app.config.test +++ b/tests/ztimer_overhead/app.config.test @@ -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 diff --git a/tests/ztimer_periodic/app.config.test b/tests/ztimer_periodic/app.config.test index a049a205fd..063d9187d5 100644 --- a/tests/ztimer_periodic/app.config.test +++ b/tests/ztimer_periodic/app.config.test @@ -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 diff --git a/tests/ztimer_rmutex_lock_timeout/app.config.test b/tests/ztimer_rmutex_lock_timeout/app.config.test index 0d12371292..b35fac38a3 100644 --- a/tests/ztimer_rmutex_lock_timeout/app.config.test +++ b/tests/ztimer_rmutex_lock_timeout/app.config.test @@ -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 diff --git a/tests/ztimer_underflow/app.config.test b/tests/ztimer_underflow/app.config.test index 733646e663..2fc4266478 100644 --- a/tests/ztimer_underflow/app.config.test +++ b/tests/ztimer_underflow/app.config.test @@ -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 diff --git a/tests/ztimer_xsec/app.config.test b/tests/ztimer_xsec/app.config.test index d39df143ba..bf645cb12e 100644 --- a/tests/ztimer_xsec/app.config.test +++ b/tests/ztimer_xsec/app.config.test @@ -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