feat: adding setting to disable autosave for ext-power and output
This commit is contained in:
parent
2ee76be6fe
commit
54527fc0d2
3 changed files with 12 additions and 2 deletions
10
app/Kconfig
10
app/Kconfig
|
@ -635,6 +635,16 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE
|
|||
int "Milliseconds to debounce settings saves"
|
||||
default 60000
|
||||
|
||||
config ZMK_SETTINGS_SAVE_ENDPOINTS
|
||||
bool "save endpoints configuration"
|
||||
depends on CONFIG_SETTINGS
|
||||
default y
|
||||
|
||||
config ZMK_SETTINGS_SAVE_EXT_POWER
|
||||
bool "save ext power state"
|
||||
depends on CONFIG_SETTINGS
|
||||
default y
|
||||
|
||||
#SETTINGS
|
||||
endif
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static struct k_work_delayable endpoints_save_work;
|
|||
#endif
|
||||
|
||||
static int endpoints_save_preferred(void) {
|
||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||
#if IS_ENABLED(CONFIG_ZMK_SETTINGS_SAVE_ENDPOINTS)
|
||||
return k_work_reschedule(&endpoints_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||
#else
|
||||
return 0;
|
||||
|
|
|
@ -47,7 +47,7 @@ static struct k_work_delayable ext_power_save_work;
|
|||
#endif
|
||||
|
||||
int ext_power_save_state(void) {
|
||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||
#if IS_ENABLED(CONFIG_ZMK_SETTINGS_SAVE_EXT_POWER)
|
||||
int ret = k_work_reschedule(&ext_power_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||
return MIN(ret, 0);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue