-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make settings_reset builds reset all settings #2072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple high level questions after a first pass at this.
d77a92e
to
d88bad6
Compare
Added the new KConfig option to the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few thoughts.
@@ -1 +1,3 @@ | |||
CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START=y | |||
CONFIG_ZMK_SETTINGS_RESET_ON_START=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this would change this shield a bit from what it used to do... I'm not sure that's a bad thing, but probably warrants a blog post or at least announcement on Discord when merged, so folks are aware of the updated functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... the other areas that would be reset by this:
- Output selection
- External power on/off
- Backlight on/off
- RGB on/off and selected effect
Of those... the output selection and external power are maybe the potentially most troublesome, but I don't think some docs/info wouldn't help address.
Let's move forward with this.
11369b8
to
415c9de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment, but this all seems reasonable. Thoughts on tweaks to the settings reset docs to make it clear what this file now does?
CONFIG_SETTINGS=y | ||
CONFIG_ZMK_SETTINGS_RESET_ON_START=y | ||
# Disable BLE so splits don't try to re-pair until normal firmware is flashed. | ||
CONFIG_ZMK_BLE=n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if this might lead to folks not being clear if the updated firmware flashed or not... Maybe a docs update to note that when you flash settings reset, the device won't be visible/connectable at all again until flashed with regular firmware?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems like it would be good to clarify. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. How does that look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Has this gotten thorough testing locally there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it with the NVS backend. The file backend is untested. I'm not sure what currently supported build (if any) could be used for that.
415c9de
to
9d4332a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going over this with a fine-toothed comb one last time, found a couple lingering items.
9d4332a
to
083a1ad
Compare
Rebased and updated everything. |
Added a zmk_settings_erase() function to clear all saved settings. This does not go through Zephyr's settings subsystem, but instead directly clears the data from the setting storage backend, so a reboot is needed for it to take effect.
Added a new CONFIG_ZMK_SETTINGS_RESET_ON_START option which enables init code to call zmk_settings_erase(), and changed the settings_reset shield to use it instead of CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START, so it now resets all settings instead of just clearing BLE bonds. CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START is left in place for now in case someone still needs it. It may be replaced in the future once we find a better way to repair a broken split connection.
Updated the section for troubleshooting split halves unable to pair now that the settings_reset shield resets all settings and explicitly disables CONFIG_ZMK_BLE: - Added a note that all settings will be reset. - Removed the section about immediately putting the halves into bootloader mode to prevent pairing, as this is not necessary anymore. - Added a note that you will not be able to see or pair the Bluetooth keyboard until you have flashed regular firmware again. - Added a sentence to clarify that you will need to re-pair the keyboard to all host devices. Also added some text describing common scenarios where this procedure might be needed.
5eff9a2
to
4c8bf3d
Compare
zmk_settings_erase()
, which directly clears the backend data for settings.settings_reset
shield to run this function on startup instead of usingCONFIG_ZMK_BLE_CLEAR_BONDS_ON_START
, so it now resets all settings instead of just Bluetooth ones.CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START
, as it is no longer needed.Future PRs can add additional ways to trigger
zmk_settings_erase()
.