Skip to content

Commit d336016

Browse files
committed
ALTERNATIVE: ztimer_periph_rtt_auto_select instead of ztimer_no_periph_rtt
This alternative would allow to disable it from BOARD or CPU Makefile.default.
1 parent e18c8c8 commit d336016

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/include/periph/rtt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*
2525
* @warning This module will be automatically be used as a backend for @ref
2626
* `ztimer_msec` and @ref `ztimer_sec`. If direct acces to RTT is needed
27-
* then include `ztimer_no_periph_rtt` to avoid auto-selection.
27+
* then disable `ztimer_periph_rtt_auto_select` to avoid auto-selection,
28+
* e.g.: `DISABLE_MODULE += ztimer_periph_rtt_auto_select`.
2829
*
2930
* @{
3031
* @file

makefiles/defaultmodules.inc.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ DEFAULT_MODULE += auto_init
55
# Initialize all used peripherals by default
66
DEFAULT_MODULE += periph_init
77

8+
# If ztimer is used enable rtt autoselection for ztimer_msec, and ztimer_sec
9+
# this will enable select `ztimer_periph_rtt` is `periph_rtt` is supported
10+
DEFAULT_MODULE += ztimer_periph_rtt_auto_select
11+
812
# Include potentially added default modules by the board
913
-include $(BOARDDIR)/Makefile.default
1014

sys/include/ztimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
* as ZTIMER_USEC does.
199199
*
200200
* If `periph_rtt` or is required with direct access by another MODULE or an
201-
* application, `ztimer_no_periph_rtt` can be included to avoid automatic
201+
* application, `ztimer_periph_rtt_auto_select` can be disabled to avoid automatic
202202
* selection of `ztimer_periph_rtt` as a backend for ZTIMER_SEC and ZTIMER_MSEC.
203203
*
204204
* These pointers are defined in `ztimer.h` and can be used like this:

sys/ztimer/Makefile.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ ifneq (,$(filter ztimer_periph_rtt,$(USEMODULE)))
1818
MODULES_ZTIMER_ON_RTT_CONFLICTING = $(filter $(MODULES_ZTIMER_ON_RTT_CONFLICT),$(USEMODULE))
1919
ifneq (0,$(words $(MODULES_ZTIMER_ON_RTT_CONFLICTING)))
2020
$(info $(COLOR_YELLOW)WARNING! The following modules conflict with `ztimer_periph_rtt`: `$(MODULES_ZTIMER_ON_RTT_CONFLICTING)`)
21-
$(info $(COLOR_YELLOW)To disable ztimer periph_rtt auto-inclusion use `ztimer_no_periph_rtt`)
21+
$(info To disable ztimer periph_rtt auto-inclusion disable `ztimer_periph_rtt_auto_select`$(COLOR_RESET))
2222
endif
2323
endif

sys/ztimer/Makefile.ztimer.rtt.dep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ifeq (,$(filter ztimer_no_periph_rtt,$(USEMODULE)))
1+
ifneq (,$(filter ztimer_periph_rtt_auto_select,$(USEMODULE)))
22
FEATURES_OPTIONAL += periph_rtt
33
# HACK: periph_rtt will get used only in the next iteration but an updated
44
# state for FEATURES_USED is needed here so include `features_check.inc.mk`

0 commit comments

Comments
 (0)