1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

*/rtt|rtc: Fix Kconfig modeling

This commit is contained in:
MrKevinWeiss 2021-09-17 10:24:08 +02:00
parent 8fc9f9a0cb
commit c7820cf7e5
No known key found for this signature in database
GPG Key ID: 3514539D7808D123
9 changed files with 45 additions and 2 deletions

View File

@ -15,3 +15,5 @@ config MODULE_BOARDS_COMMON_NUCLEO
stm32 common nucleo code.
endif # TEST_KCONFIG
rsource "../stm32/Kconfig"

View File

@ -16,6 +16,9 @@ config CPU_STM32
select HAS_PERIPH_UART_MODECFG
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
config CPU
default "stm32" if CPU_STM32

View File

@ -126,6 +126,11 @@ config MODULE_PERIPH_RTT_SET_COUNTER
bool "rtc_set_counter() implementation in the RTT peripheral driver"
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
bool "Auto initialize RTT peripheral"
default y if MODULE_PERIPH_INIT

View File

@ -15,5 +15,21 @@ config MODULE_PERIPH_INIT_RTC
default y if MODULE_PERIPH_INIT
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
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.rtc"

View File

@ -76,8 +76,7 @@ choice
depends on MODULE_ZTIMER_SEC
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
!CPU_COMMON_SAM0 && \
!CPU_COMMON_EFM32 && \
!CPU_FAM_F1
!CPU_COMMON_EFM32
default ZTIMER_SEC_BACKEND_RTT
config ZTIMER_SEC_BACKEND_TIMER

11
tests/periph_rtc/Kconfig Normal file
View 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

View File

@ -8,4 +8,7 @@ DISABLE_MODULE += periph_init_rtc
USEMODULE += xtimer
# avoid running Kconfig by default
SHOULD_RUN_KCONFIG ?=
include $(RIOTBASE)/Makefile.include

View File

@ -9,4 +9,5 @@ config APPLICATION
bool
default y
imply MODULE_PERIPH_RTT_SET_COUNTER
imply MODULE_PERIPH_RTC_MEM
depends on TEST_KCONFIG

View File

@ -7,6 +7,9 @@ FEATURES_OPTIONAL += periph_rtc_mem
DISABLE_MODULE += periph_init_rtt
# avoid running Kconfig by default
SHOULD_RUN_KCONFIG ?=
include $(RIOTBASE)/Makefile.include
# Put board specific dependencies here