From e04169d2d618e034a8f977acb385a8dbed158fdb Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 19 Nov 2021 09:37:59 +0100 Subject: [PATCH] drivers/tmp00x/kconfig: rework modelling --- drivers/tmp00x/Kconfig | 53 ++++++++++++++++++----------- tests/driver_tmp00x/app.config.test | 1 + 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/drivers/tmp00x/Kconfig b/drivers/tmp00x/Kconfig index 6f24023d4a..55905238b0 100644 --- a/drivers/tmp00x/Kconfig +++ b/drivers/tmp00x/Kconfig @@ -6,30 +6,45 @@ # directory for more details. # -if TEST_KCONFIG - -choice - bool "TMP006/TMP007 Infrared Thermopile sensors" - optional - depends on HAS_PERIPH_I2C - -config MODULE_TMP006 - bool "TMP006" - select MODULE_TMP00X - -config MODULE_TMP007 - bool "TMP007" - select MODULE_TMP00X - -endchoice - -config MODULE_TMP00X +menuconfig MODULE_TMP00X bool + prompt "TMP006/TMP007 Infrared Thermopile sensors" if !(HAVE_TMP00X && MODULE_SAUL_DEFAULT) + default y if (HAVE_TMP00X && MODULE_SAUL_DEFAULT) + depends on TEST_KCONFIG depends on HAS_PERIPH_I2C select MODULE_PERIPH_I2C select MODULE_XTIMER -endif # TEST_KCONFIG +choice + bool "Sensor variant" + default MODULE_TMP006 if HAVE_TMP006 + default MODULE_TMP007 if HAVE_TMP007 + depends on MODULE_TMP00X + +config MODULE_TMP006 + bool "TMP006" + +config MODULE_TMP007 + bool "TMP007" + +endchoice + +config HAVE_TMP006 + bool + select HAVE_TMP00X + help + Indicates that a tmp006 infrared sensor is present. + +config HAVE_TMP007 + bool + select HAVE_TMP00X + help + Indicates that a tmp007 infrared sensor is present. + +config HAVE_TMP00X + bool + help + Indicates that a tmp00x infrared sensor is present. menuconfig KCONFIG_USEMODULE_TMP00X bool "Configure TMP00X driver" diff --git a/tests/driver_tmp00x/app.config.test b/tests/driver_tmp00x/app.config.test index c80016ae6b..d5334f04be 100644 --- a/tests/driver_tmp00x/app.config.test +++ b/tests/driver_tmp00x/app.config.test @@ -1,4 +1,5 @@ # this file enables modules defined in Kconfig. Do not use this file for # application configuration. This is only needed during migration. +CONFIG_MODULE_TMP00X=y CONFIG_MODULE_TMP006=y CONFIG_MODULE_XTIMER=y