zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.51k stars 2.57k forks source link

fix: Improve startup time with proper settings loading. #2358

Closed petejohanson closed 2 weeks ago

petejohanson commented 2 weeks ago

Found this during Studio work, after we ended up with many more settings entries. Pinned it down to the many calls to settings_load_subtree which under the hood was actually loading the full NVS data each time, doing a ton of duplicate work. This refactor moves away from duplicate subtree loads. Doing so requires a bit of care to make timing work and have the right things loaded when needed, especially for BT initialization.