drivers/kconfig: simplify shared rtt/rtc hardware in kconfig

This commit is contained in:
MrKevinWeiss 2021-10-13 09:46:21 +02:00
parent 57afe40e25
commit 9b6a63a951
No known key found for this signature in database
GPG Key ID: 3514539D7808D123
6 changed files with 11 additions and 12 deletions

View File

@ -16,6 +16,7 @@ config CPU_COMMON_EFM32
select HAS_PERIPH_RTT_SET_COUNTER
select HAS_PERIPH_RTT_OVERFLOW
select HAS_PERIPH_WDT
select HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
config CPU_EFM32_SERIES0
bool
@ -45,9 +46,5 @@ config HAS_EFM32_CORETEMP
config CPU
default "efm32" if CPU_COMMON_EFM32
config ERROR_MODULES_CONFLICT
default "On the EFM32, the RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT
depends on CPU_COMMON_EFM32
orsource "families/*/Kconfig"
source "$(RIOTCPU)/cortexm_common/Kconfig"

View File

@ -25,14 +25,12 @@ config CPU_COMMON_SAM0
select HAS_PERIPH_WDT
select HAS_PERIPH_WDT_CB
select HAS_PERIPH_WDT_WARNING_PERIOD
select HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
if CPU_COMMON_SAM0
rsource "periph/Kconfig"
config ERROR_MODULES_CONFLICT
default "On SAM0, the RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT
endif # CPU_COMMON_SAM0
source "$(RIOTCPU)/cortexm_common/Kconfig"

View File

@ -17,15 +17,13 @@ config CPU_FAM_F1
select HAS_PERIPH_FLASHPAGE_RAW
select HAS_PERIPH_RTT_SET_COUNTER
select HAS_PERIPH_WDT
select HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
if CPU_FAM_F1
config CPU_FAM
default "f1"
config ERROR_MODULES_CONFLICT
default "On STM32F1, the RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT
endif # CPU_FAM_F1
config HAS_CPU_STM32F1

View File

@ -162,5 +162,11 @@ config MODULE_PERIPH_INIT_USBDEV
endif # TEST_KCONFIG
config HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
bool
help
The periph_rtc module or the periph_rtt module share hardware, thus,
only one can be selected.
rsource "Kconfig.timer"
rsource "Kconfig.wdt"

View File

@ -15,6 +15,7 @@
config ERROR_MODULES_CONFLICT
string
default "The RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT && HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
help
Used to indicate that conflicting modules (i.e. modules that can't be
active at the same time) are being used together.

View File

@ -75,8 +75,7 @@ choice
bool "Backend"
depends on MODULE_ZTIMER_SEC
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
!CPU_COMMON_SAM0 && \
!CPU_COMMON_EFM32
!HAVE_SHARED_PERIPH_RTT_PERIPH_RTC
default ZTIMER_SEC_BACKEND_RTT
config ZTIMER_SEC_BACKEND_TIMER