File tree Expand file tree Collapse file tree 5 files changed +36
-7
lines changed
boards/shields/settings_reset Expand file tree Collapse file tree 5 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -560,6 +560,11 @@ endif
560
560
#Logging
561
561
endmenu
562
562
563
+ config ZMK_SETTINGS_RESET_ON_START
564
+ bool "Delete all persistent settings when the keyboard boots"
565
+ default n
566
+ select SETTINGS
567
+
563
568
if SETTINGS
564
569
565
570
config ZMK_SETTINGS_SAVE_DEBOUNCE
Original file line number Diff line number Diff line change 1
- CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START=y
1
+ CONFIG_ZMK_SETTINGS_RESET_ON_START=y
2
+ # Disable BLE so splits don't try to re-pair until normal firmware is flashed.
3
+ CONFIG_ZMK_BLE=n
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ target_sources_ifdef(CONFIG_SETTINGS_NONE app PRIVATE reset_settings_none.c)
5
5
target_sources_ifdef (CONFIG_SETTINGS_FCB app PRIVATE reset_settings_fcb.c )
6
6
target_sources_ifdef (CONFIG_SETTINGS_FILE app PRIVATE reset_settings_file.c )
7
7
target_sources_ifdef (CONFIG_SETTINGS_NVS app PRIVATE reset_settings_nvs.c )
8
+
9
+ target_sources_ifdef (CONFIG_ZMK_SETTINGS_RESET_ON_START app PRIVATE reset_settings_on_start.c )
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2023 The ZMK Contributors
3
+ *
4
+ * SPDX-License-Identifier: MIT
5
+ */
6
+
7
+ #include <zephyr/device.h>
8
+ #include <zephyr/init.h>
9
+
10
+ #include <zmk/settings.h>
11
+
12
+ static int reset_settings_init (const struct device * dev ) {
13
+ ARG_UNUSED (dev );
14
+ return zmk_settings_erase ();
15
+ }
16
+
17
+ // Reset after the kernel is initialized but before any application code to
18
+ // ensure settings are cleared before anything tries to use them.
19
+ SYS_INIT (reset_settings_init , POST_KERNEL , CONFIG_APPLICATION_INIT_PRIORITY );
Original file line number Diff line number Diff line change @@ -13,12 +13,13 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
13
13
14
14
### General
15
15
16
- | Config | Type | Description | Default |
17
- | ----------------------------------- | ------ | ----------------------------------------------------------------------------- | ------- |
18
- | ` CONFIG_ZMK_KEYBOARD_NAME ` | string | The name of the keyboard (max 16 characters) | |
19
- | ` CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE ` | int | Milliseconds to wait after a setting change before writing it to flash memory | 60000 |
20
- | ` CONFIG_ZMK_WPM ` | bool | Enable calculating words per minute | n |
21
- | ` CONFIG_HEAP_MEM_POOL_SIZE ` | int | Size of the heap memory pool | 8192 |
16
+ | Config | Type | Description | Default |
17
+ | ------------------------------------ | ------ | ----------------------------------------------------------------------------- | ------- |
18
+ | ` CONFIG_ZMK_KEYBOARD_NAME ` | string | The name of the keyboard (max 16 characters) | |
19
+ | ` CONFIG_ZMK_SETTINGS_RESET_ON_START ` | bool | Clears all persistent settings from the keyboard at startup | n |
20
+ | ` CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE ` | int | Milliseconds to wait after a setting change before writing it to flash memory | 60000 |
21
+ | ` CONFIG_ZMK_WPM ` | bool | Enable calculating words per minute | n |
22
+ | ` CONFIG_HEAP_MEM_POOL_SIZE ` | int | Size of the heap memory pool | 8192 |
22
23
23
24
### HID
24
25
You can’t perform that action at this time.
0 commit comments