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

This commit is contained in:
Cem Aksoylar 2022-05-16 21:51:28 -07:00 committed by Pete Johanson
parent 56fb07dffe
commit 25f89ee6ab
2 changed files with 6 additions and 1 deletions

View file

@ -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

View file

@ -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;
}