*/rtt|rtc: Fix Kconfig modeling
This commit is contained in:
parent
8fc9f9a0cb
commit
c7820cf7e5
@ -15,3 +15,5 @@ config MODULE_BOARDS_COMMON_NUCLEO
|
|||||||
stm32 common nucleo code.
|
stm32 common nucleo code.
|
||||||
|
|
||||||
endif # TEST_KCONFIG
|
endif # TEST_KCONFIG
|
||||||
|
|
||||||
|
rsource "../stm32/Kconfig"
|
||||||
|
|||||||
@ -16,6 +16,9 @@ config CPU_STM32
|
|||||||
select HAS_PERIPH_UART_MODECFG
|
select HAS_PERIPH_UART_MODECFG
|
||||||
select HAS_PERIPH_UART_NONBLOCKING
|
select HAS_PERIPH_UART_NONBLOCKING
|
||||||
|
|
||||||
|
# This CPU requires periph_rtc when periph_rtc_mem
|
||||||
|
select MODULE_PERIPH_RTC if MODULE_PERIPH_RTC_MEM && HAS_PERIPH_RTC
|
||||||
|
|
||||||
# Common CPU symbol
|
# Common CPU symbol
|
||||||
config CPU
|
config CPU
|
||||||
default "stm32" if CPU_STM32
|
default "stm32" if CPU_STM32
|
||||||
|
|||||||
@ -126,6 +126,11 @@ config MODULE_PERIPH_RTT_SET_COUNTER
|
|||||||
bool "rtc_set_counter() implementation in the RTT peripheral driver"
|
bool "rtc_set_counter() implementation in the RTT peripheral driver"
|
||||||
depends on HAS_PERIPH_RTT_SET_COUNTER && MODULE_PERIPH_RTT
|
depends on HAS_PERIPH_RTT_SET_COUNTER && MODULE_PERIPH_RTT
|
||||||
|
|
||||||
|
config MODULE_PERIPH_INIT_RTT_SET_COUNTER
|
||||||
|
bool "Auto initialize rtc_set_counter() with RTT"
|
||||||
|
default y if MODULE_PERIPH_INIT
|
||||||
|
depends on MODULE_PERIPH_RTT_SET_COUNTER
|
||||||
|
|
||||||
config MODULE_PERIPH_INIT_RTT
|
config MODULE_PERIPH_INIT_RTT
|
||||||
bool "Auto initialize RTT peripheral"
|
bool "Auto initialize RTT peripheral"
|
||||||
default y if MODULE_PERIPH_INIT
|
default y if MODULE_PERIPH_INIT
|
||||||
|
|||||||
@ -15,5 +15,21 @@ config MODULE_PERIPH_INIT_RTC
|
|||||||
default y if MODULE_PERIPH_INIT
|
default y if MODULE_PERIPH_INIT
|
||||||
depends on MODULE_PERIPH_RTC
|
depends on MODULE_PERIPH_RTC
|
||||||
|
|
||||||
|
config MODULE_PERIPH_RTC_MEM
|
||||||
|
bool "Low-Power RTC Memory"
|
||||||
|
depends on HAS_PERIPH_RTC_MEM
|
||||||
|
help
|
||||||
|
Provides an interface to access low-power memory present on some RTCs.
|
||||||
|
This memory is retained even when the rest of the system is powered off.
|
||||||
|
|
||||||
|
# TODO: this module is actually just an artifact from the way periph_init_%
|
||||||
|
# modules are handled in Makefile. We need to define it to keep the list the
|
||||||
|
# same for now. We should be able to remove it later on.
|
||||||
|
|
||||||
|
config MODULE_PERIPH_INIT_RTC_MEM
|
||||||
|
bool
|
||||||
|
default y if MODULE_PERIPH_INIT
|
||||||
|
depends on MODULE_PERIPH_RTC_MEM
|
||||||
|
|
||||||
# Include CPU specific configurations
|
# Include CPU specific configurations
|
||||||
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.rtc"
|
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.rtc"
|
||||||
|
|||||||
@ -76,8 +76,7 @@ choice
|
|||||||
depends on MODULE_ZTIMER_SEC
|
depends on MODULE_ZTIMER_SEC
|
||||||
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
|
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
|
||||||
!CPU_COMMON_SAM0 && \
|
!CPU_COMMON_SAM0 && \
|
||||||
!CPU_COMMON_EFM32 && \
|
!CPU_COMMON_EFM32
|
||||||
!CPU_FAM_F1
|
|
||||||
default ZTIMER_SEC_BACKEND_RTT
|
default ZTIMER_SEC_BACKEND_RTT
|
||||||
|
|
||||||
config ZTIMER_SEC_BACKEND_TIMER
|
config ZTIMER_SEC_BACKEND_TIMER
|
||||||
|
|||||||
11
tests/periph_rtc/Kconfig
Normal file
11
tests/periph_rtc/Kconfig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Copyright (c) 2021 HAW Hamburg
|
||||||
|
#
|
||||||
|
# This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
# General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
# directory for more details.
|
||||||
|
#
|
||||||
|
|
||||||
|
config APPLICATION
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
imply MODULE_PERIPH_RTC_MEM
|
||||||
@ -8,4 +8,7 @@ DISABLE_MODULE += periph_init_rtc
|
|||||||
|
|
||||||
USEMODULE += xtimer
|
USEMODULE += xtimer
|
||||||
|
|
||||||
|
# avoid running Kconfig by default
|
||||||
|
SHOULD_RUN_KCONFIG ?=
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -9,4 +9,5 @@ config APPLICATION
|
|||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
imply MODULE_PERIPH_RTT_SET_COUNTER
|
imply MODULE_PERIPH_RTT_SET_COUNTER
|
||||||
|
imply MODULE_PERIPH_RTC_MEM
|
||||||
depends on TEST_KCONFIG
|
depends on TEST_KCONFIG
|
||||||
|
|||||||
@ -7,6 +7,9 @@ FEATURES_OPTIONAL += periph_rtc_mem
|
|||||||
|
|
||||||
DISABLE_MODULE += periph_init_rtt
|
DISABLE_MODULE += periph_init_rtt
|
||||||
|
|
||||||
|
# avoid running Kconfig by default
|
||||||
|
SHOULD_RUN_KCONFIG ?=
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|
||||||
# Put board specific dependencies here
|
# Put board specific dependencies here
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user