From 7c5630032f3410f522e015fb2561b49a0e92f66e Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 30 Sep 2021 13:41:51 +0200 Subject: [PATCH] drivers/bmx280: refactor Kconfig model --- drivers/bmx280/Kconfig | 45 ++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/drivers/bmx280/Kconfig b/drivers/bmx280/Kconfig index 8aaa770554..1b45c8d2e0 100644 --- a/drivers/bmx280/Kconfig +++ b/drivers/bmx280/Kconfig @@ -5,20 +5,24 @@ # directory for more details. # -menuconfig MODULE_BMX280 - bool "BMx280 Temperature, pressure and humidity sensors" - depends on TEST_KCONFIG - help - The driver supports both BME280 and BMP280 connected either via SPI or - I2C bus. Select one combination. -choice - bool "Sensor variant" - depends on MODULE_BMX280 +menuconfig MODULE_BMX280 + bool + prompt "BMx280 Temperature, pressure and humidity sensors" if !(MODULE_SAUL_DEFAULT && HAVE_BMX280) + default (MODULE_SAUL_DEFAULT && HAVE_BMX280) + depends on TEST_KCONFIG + +if MODULE_BMX280 + +choice BMX280_VARIANT + bool "Model" default MODULE_BME280_I2C if HAVE_BME280_I2C default MODULE_BME280_SPI if HAVE_BME280_SPI default MODULE_BMP280_I2C if HAVE_BMP280_I2C default MODULE_BMP280_SPI if HAVE_BMP280_SPI + help + The driver supports both BME280 and BMP280 connected either via SPI or + I2C bus. Select one combination. config MODULE_BME280_I2C bool "BME280 on I2C" @@ -46,26 +50,33 @@ config MODULE_BMP280_SPI endchoice +endif # MODULE_BMX280 + config HAVE_BME280_I2C bool - select MODULE_BMX280 if MODULE_SAUL_DEFAULT + select HAVE_BMX280 help - Indicates that a bme280 is present on the I2C bus. + Indicates that a bme280 sensor on the I2C bus is present. config HAVE_BME280_SPI bool - select MODULE_BMX280 if MODULE_SAUL_DEFAULT + select HAVE_BMX280 help - Indicates that a bme280 is present on the SPI bus. + Indicates that a bme280 sensor on the SPI bus is present. config HAVE_BMP280_I2C bool - select MODULE_BMX280 if MODULE_SAUL_DEFAULT + select HAVE_BMX280 help - Indicates that a bmp280 is present on the I2C bus. + Indicates that a bmp280 sensor on the I2C bus is present. config HAVE_BMP280_SPI bool - select MODULE_BMX280 if MODULE_SAUL_DEFAULT + select HAVE_BMX280 help - Indicates that a bmp280 is present on the SPI bus. + Indicates that a bmp280 sensor on the SPI bus is present. + +config HAVE_BMX280 + bool + help + Indicates that a bmx280 sensor is present.