Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(bluetooth): Add battery reporting config.
Browse files Browse the repository at this point in the history
* Add dedicated battery reporting Kconfig that is `imply`d by
  enabling ZMK_BLE.
petejohanson committed Apr 18, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 37a4cde commit f51b3fa
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
8 changes: 7 additions & 1 deletion app/Kconfig
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f51b3fa

Please sign in to comment.