kconfig: add ERROR symbol for conflicting modules

This commit is contained in:
Leandro Lanzieri 2020-09-24 15:21:07 +02:00
parent 34d84ad8c6
commit fe6d66d92a
No known key found for this signature in database
GPG Key ID: 13559905E2EBEAA5
7 changed files with 46 additions and 0 deletions

View File

@ -12,6 +12,9 @@ rsource "kconfigs/Kconfig.consts"
# Load feature declarations
rsource "kconfigs/Kconfig.features"
# Load error symbols
rsource "kconfigs/Kconfig.errors"
# For now, get used modules as macros from this file (see kconfig.mk)
osource "$(KCONFIG_GENERATED_DEPENDENCIES)"
@ -33,6 +36,9 @@ rsource "pkg/Kconfig"
comment "RIOT is in a migration phase."
comment "Some configuration options may not be here. Use CFLAGS instead."
comment "!! ERROR: There are conflicting modules active !!"
depends on ERROR_MODULES_CONFLICT != ""
config TEST_KCONFIG
bool
default y if '$(TEST_KCONFIG)' = '1'

View File

@ -27,3 +27,7 @@ config BOARD_STM32F4DISCOVERY
# Various other features (if any)
select HAS_ARDUINO
config ERROR_MODULES_CONFLICT
default "On stm32f4discovery boards there are the same pins for the DAC and/or SPI_0." if MODULE_PERIPH_SPI && MODULE_PERIPH_DAC
depends on BOARD_STM32F4DISCOVERY

View File

@ -68,3 +68,7 @@ config HAS_ATMEGA_PCINT3
bool
help
Indicates that the Pin Change Interrupt bank 3 is present.
config ERROR_MODULES_CONFLICT
default "On ATmega, the RTC and RTT use to the same hardware timer." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT
depends on CPU_COMMON_ATMEGA

View File

@ -37,5 +37,9 @@ config HAS_CPU_EFM32
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

@ -28,6 +28,9 @@ 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

@ -32,7 +32,12 @@ config HAS_BOOTLOADER_STM32
help
Indicates that the stm32 bootloader is being used.
config ERROR_MODULES_CONFLICT
default "On STM32, the RTC and RTT map to the same hardware peripheral." if MODULE_PERIPH_RTC && MODULE_PERIPH_RTT
depends on CPU_STM32
orsource "kconfig/*/Kconfig"
orsource "kconfig/*/Kconfig.lines"
orsource "kconfig/*/Kconfig.models"
source "$(RIOTCPU)/cortexm_common/Kconfig"

20
kconfigs/Kconfig.errors Normal file
View File

@ -0,0 +1,20 @@
# Copyright (c) 2020 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.
#
# Definition of common error symbols. To indicate an error set the default value
# to the correspondent symbol guarded with the error condition. e.g.:
#
# config ERROR_MODULES_CONFLICT
# default "On SAM0 platforms RTT and RTC cannot be set at the same time"
# depends on MODULE_PERIPH_RTC && MODULE_PERIPH_RTT && CPU_COMMON_SAM0
#
config ERROR_MODULES_CONFLICT
string
help
Used to indicate that conflicting modules (i.e. modules that can't be
active at the same time) are being used together.