refactor(battery): Auto enable battery drivers
CONFIG_ZMK_BATTERY_NRF_VDDH and CONFIG_ZMK_BATTERY_VOLTAGE_DIVIDER are now automatically enabled if a DT node with the matching "compatible" property is present and enabled, so they no longer need to be manually set for each board.
This commit is contained in:
parent
6d6efa32f5
commit
11ab52582c
9 changed files with 7 additions and 35 deletions
|
@ -24,7 +24,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_BLUEMICRO840_V1
|
||||
|
|
|
@ -25,9 +25,6 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "BT60"
|
||||
|
||||
|
|
|
@ -34,7 +34,4 @@ choice BOARD_MIKOTO_CHARGER_CURRENT
|
|||
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
|
||||
endchoice
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_MIKOTO_520
|
||||
|
|
|
@ -22,7 +22,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE60
|
||||
|
|
|
@ -23,17 +23,3 @@ config ZMK_USB
|
|||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2
|
||||
|
||||
if BOARD_NICE_NANO
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO
|
||||
|
||||
if BOARD_NICE_NANO_V2
|
||||
|
||||
config ZMK_BATTERY_NRF_VDDH
|
||||
default y
|
||||
|
||||
endif # BOARD_NICE_NANO_V2
|
||||
|
|
|
@ -32,9 +32,6 @@ if BOARD_NRFMICRO_13
|
|||
config BOARD_NRFMICRO_CHARGER
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_NRFMICRO_13
|
||||
|
||||
endif # BOARD_NRFMICRO_11 || BOARD_NRFMICRO_11_FLIPPED || BOARD_NRFMICRO_13
|
||||
|
|
|
@ -25,7 +25,4 @@ config ZMK_BLE
|
|||
config ZMK_USB
|
||||
default y
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
default y
|
||||
|
||||
endif # BOARD_S40NC
|
||||
|
|
|
@ -3,7 +3,6 @@ CONFIG_CONSOLE=n
|
|||
CONFIG_SERIAL=n
|
||||
CONFIG_UART_CONSOLE=n
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=n
|
||||
CONFIG_ZMK_BATTERY_VOLTAGE_DIVIDER=y
|
||||
CONFIG_ZMK_USB=y
|
||||
CONFIG_ZMK_BLE=y
|
||||
|
||||
|
|
|
@ -1,20 +1,25 @@
|
|||
# Copyright (c) 2020-2021 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
DT_COMPAT_ZMK_BATTERY_NRF_VDDH := zmk,battery-nrf-vddh
|
||||
DT_COMPAT_ZMK_BATTERY_VOLTAGE_DIVIDER := zmk,battery-voltage-divider
|
||||
|
||||
config ZMK_BATTERY
|
||||
bool "ZMK battery monitoring"
|
||||
help
|
||||
Enable battery monitoring
|
||||
|
||||
config ZMK_BATTERY_NRF_VDDH
|
||||
bool "ZMK nRF VDDH battery monitoring"
|
||||
bool
|
||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_BATTERY_NRF_VDDH))
|
||||
select ADC
|
||||
select ZMK_BATTERY
|
||||
help
|
||||
Enable ZMK nRF VDDH voltage driver for battery monitoring.
|
||||
|
||||
config ZMK_BATTERY_VOLTAGE_DIVIDER
|
||||
bool "ZMK battery voltage divider"
|
||||
bool
|
||||
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_BATTERY_VOLTAGE_DIVIDER))
|
||||
select ADC
|
||||
select ZMK_BATTERY
|
||||
help
|
||||
|
|
Loading…
Reference in a new issue