Skip to content

Commit

Permalink
refactor(battery): disable BLE battery reporting
Browse files Browse the repository at this point in the history
Disable battery reporting, stops spurious wakeups on Macs
  • Loading branch information
ReFil committed May 30, 2023
1 parent 1b6af51 commit 2797cc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ menuconfig ZMK_BLE
select BT_SMP_APP_PAIRING_ACCEPT
select BT_PERIPHERAL
select BT_DIS
select BT_BAS
select BT_SETTINGS
select SETTINGS

Expand Down
2 changes: 2 additions & 0 deletions app/src/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static int zmk_battery_update(const struct device *battery) {
if (last_state_of_charge != state_of_charge.val1) {
last_state_of_charge = state_of_charge.val1;

/*
LOG_DBG("Setting BAS GATT battery level to %d.", last_state_of_charge);
rc = bt_bas_set_battery_level(last_state_of_charge);
Expand All @@ -59,6 +60,7 @@ static int zmk_battery_update(const struct device *battery) {
LOG_WRN("Failed to set BAS GATT battery level (err %d)", rc);
return rc;
}
*/

rc = ZMK_EVENT_RAISE(new_zmk_battery_state_changed(
(struct zmk_battery_state_changed){.state_of_charge = last_state_of_charge}));
Expand Down

0 comments on commit 2797cc9

Please sign in to comment.