diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 3da50b57e5d2..fb7b12225313 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -75,8 +75,8 @@ endif() target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/behaviors/behavior_rgb_underglow.c) target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/behaviors/behavior_backlight.c) -target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/events/battery_state_changed.c) -target_sources_ifdef(CONFIG_ZMK_BLE app PRIVATE src/battery.c) +target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/events/battery_state_changed.c) +target_sources_ifdef(CONFIG_ZMK_BATTERY_REPORTING app PRIVATE src/battery.c) target_sources_ifdef(CONFIG_ZMK_SPLIT app PRIVATE src/events/split_peripheral_status_changed.c) add_subdirectory(src/split) diff --git a/app/Kconfig b/app/Kconfig index 30902b96e041..be5a6329d8a7 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -114,9 +114,9 @@ menuconfig ZMK_BLE select BT_SMP_APP_PAIRING_ACCEPT select BT_PERIPHERAL select BT_DIS - select BT_BAS select BT_SETTINGS select SETTINGS + imply ZMK_BATTERY_REPORTING if ZMK_BLE @@ -312,6 +312,12 @@ endmenu menu "Power Management" +config ZMK_BATTERY_REPORTING + bool "Battery level detection/reporting" + default n + select SENSOR + select BT_BAS if ZMK_BLE + config ZMK_IDLE_TIMEOUT int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)" default 30000