Browse Source

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

xmkb
Cem Aksoylar 2 years ago committed by Pete Johanson
parent
commit
25f89ee6ab
  1. 5
      app/Kconfig
  2. 2
      app/src/battery.c

5
app/Kconfig

@ -518,6 +518,11 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE @@ -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

2
app/src/battery.c

@ -104,7 +104,7 @@ static int zmk_battery_init(const struct device *_arg) { @@ -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;
}

Loading…
Cancel
Save