Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(battery): Add Kconfig setting for battery level report interval #1303

Merged
merged 1 commit into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE
#SETTINGS
endif

config ZMK_BATTERY_REPORT_INTERVAL
depends on ZMK_BLE
int "Battery level report interval in seconds"
default 60

#Advanced
endmenu

Expand Down
2 changes: 1 addition & 1 deletion app/src/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int zmk_battery_init(const struct device *_arg) {
return rc;
}

k_timer_start(&battery_timer, K_MINUTES(1), K_MINUTES(1));
k_timer_start(&battery_timer, K_MINUTES(1), K_SECONDS(CONFIG_ZMK_BATTERY_REPORT_INTERVAL));

return 0;
}
Expand Down