From 4d50e49d0064a0b70fcd1a3f1801a719bc4cff23 Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sat, 2 Oct 2021 12:16:59 -0700 Subject: [PATCH] refactor(boards): Refactor battery_voltage_divider Kconfig to not select ADC --- app/boards/arm/bluemicro840/bluemicro840_v1_defconfig | 3 +++ app/boards/arm/nice60/nice60_defconfig | 3 +++ app/boards/arm/nice_nano/nice_nano_defconfig | 3 +++ app/boards/arm/nice_nano/nice_nano_v2_defconfig | 3 +++ app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig | 3 +++ app/boards/arm/nrfmicro/nrfmicro_11_defconfig | 3 +++ app/boards/arm/nrfmicro/nrfmicro_13_defconfig | 3 +++ app/drivers/sensor/battery/Kconfig | 5 +++-- 8 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig b/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig index 96f03ca4..f4f6837f 100644 --- a/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig +++ b/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nice60/nice60_defconfig b/app/boards/arm/nice60/nice60_defconfig index 3a3a978f..17a3347b 100644 --- a/app/boards/arm/nice60/nice60_defconfig +++ b/app/boards/arm/nice60/nice60_defconfig @@ -11,6 +11,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nice_nano/nice_nano_defconfig b/app/boards/arm/nice_nano/nice_nano_defconfig index 393d61fe..b7b32078 100644 --- a/app/boards/arm/nice_nano/nice_nano_defconfig +++ b/app/boards/arm/nice_nano/nice_nano_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nice_nano/nice_nano_v2_defconfig b/app/boards/arm/nice_nano/nice_nano_v2_defconfig index d061e389..cfd5ed37 100644 --- a/app/boards/arm/nice_nano/nice_nano_v2_defconfig +++ b/app/boards/arm/nice_nano/nice_nano_v2_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig b/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig index 2f563c38..6c605074 100644 --- a/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig +++ b/app/boards/arm/nrf52840_m2/nrf52840_m2_defconfig @@ -11,6 +11,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_defconfig b/app/boards/arm/nrfmicro/nrfmicro_11_defconfig index c1ac8364..e962757d 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_11_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig index cac11642..c79e2dfe 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# enable ADC +CONFIG_ADC=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_MPU_ALLOW_FLASH_WRITE=y diff --git a/app/drivers/sensor/battery/Kconfig b/app/drivers/sensor/battery/Kconfig index fd8cd26d..b4b69bc6 100644 --- a/app/drivers/sensor/battery/Kconfig +++ b/app/drivers/sensor/battery/Kconfig @@ -3,19 +3,20 @@ config ZMK_BATTERY bool "ZMK battery monitoring" + depends on ADC help Enable battery monitoring config ZMK_BATTERY_NRF_VDDH bool "ZMK nRF VDDH battery monitoring" - select ADC + depends on ADC select ZMK_BATTERY help Enable ZMK nRF VDDH voltage driver for battery monitoring. config ZMK_BATTERY_VOLTAGE_DIVIDER bool "ZMK battery voltage divider" - select ADC + depends on ADC select ZMK_BATTERY help Enable ZMK battery voltage divider driver for battery monitoring.