Skip to content

Commit

Permalink
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.
  • Loading branch information
petejohanson authored and DerDreschner committed Jun 26, 2023
1 parent 1560cf6 commit 881da25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,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(app PRIVATE src/events/hid_indicators_changed.c)

Expand Down
7 changes: 7 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ menuconfig ZMK_BLE
select BT_DIS
select BT_SETTINGS
select SETTINGS
imply ZMK_BATTERY_REPORTING

if ZMK_BLE

Expand Down Expand Up @@ -328,6 +329,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
Expand Down

0 comments on commit 881da25

Please sign in to comment.