Merge 44f687f33e
into b735a051ce
This commit is contained in:
commit
871e614e6d
6 changed files with 14 additions and 2 deletions
|
@ -647,6 +647,14 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE
|
||||||
int "Milliseconds to debounce settings saves"
|
int "Milliseconds to debounce settings saves"
|
||||||
default 60000
|
default 60000
|
||||||
|
|
||||||
|
config ZMK_SETTINGS_SAVE_ENDPOINTS
|
||||||
|
bool "save endpoints configuration"
|
||||||
|
default y
|
||||||
|
|
||||||
|
config ZMK_SETTINGS_SAVE_EXT_POWER
|
||||||
|
bool "save ext power state"
|
||||||
|
default y
|
||||||
|
|
||||||
#SETTINGS
|
#SETTINGS
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ static struct k_work_delayable endpoints_save_work;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int endpoints_save_preferred(void) {
|
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));
|
return k_work_reschedule(&endpoints_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -47,7 +47,7 @@ static struct k_work_delayable ext_power_save_work;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ext_power_save_state(void) {
|
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));
|
int ret = k_work_reschedule(&ext_power_save_work, K_MSEC(CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE));
|
||||||
return MIN(ret, 0);
|
return MIN(ret, 0);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -47,6 +47,7 @@ The output selection behavior changes the preferred output on press.
|
||||||
:::note[Output selection persistence]
|
:::note[Output selection persistence]
|
||||||
The endpoint that is selected by the `&out` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
|
The endpoint that is selected by the `&out` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
|
||||||
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
|
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
|
||||||
|
This can be disabled by unsetting [`CONFIG_ZMK_SETTINGS_SAVE_ENDPOINTS`](../config/system.md#general)
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
|
@ -46,6 +46,7 @@ Here is a table describing the command for each define:
|
||||||
:::note[External power state persistence]
|
:::note[External power state persistence]
|
||||||
The on/off state that is set by the `&ext_power` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
|
The on/off state that is set by the `&ext_power` behavior will be saved to flash storage and hence persist across restarts and firmware flashes.
|
||||||
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
|
However it will only be saved after [`CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE`](../config/system.md#general) milliseconds in order to reduce potential wear on the flash memory.
|
||||||
|
This can be disabled by unsetting [`CONFIG_ZMK_SETTINGS_SAVE_EXT_POWER`](../config/system.md#general)
|
||||||
:::
|
:::
|
||||||
|
|
||||||
### Example:
|
### Example:
|
||||||
|
|
|
@ -20,6 +20,8 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
|
||||||
| `CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE` | int | Milliseconds to wait after a setting change before writing it to flash memory | 60000 |
|
| `CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE` | int | Milliseconds to wait after a setting change before writing it to flash memory | 60000 |
|
||||||
| `CONFIG_ZMK_WPM` | bool | Enable calculating words per minute | n |
|
| `CONFIG_ZMK_WPM` | bool | Enable calculating words per minute | n |
|
||||||
| `CONFIG_HEAP_MEM_POOL_SIZE` | int | Size of the heap memory pool | 8192 |
|
| `CONFIG_HEAP_MEM_POOL_SIZE` | int | Size of the heap memory pool | 8192 |
|
||||||
|
| `CONFIG_ZMK_SETTINGS_SAVE_ENDPOINTS` | bool | Enable automatic saving of the selected endpoint (USB / BT) | y |
|
||||||
|
| `CONFIG_ZMK_SETTINGS_SAVE_EXT_POWER` | bool | Enable automatic saving of the selected ext_power persistance state | y |
|
||||||
|
|
||||||
### HID
|
### HID
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue