load settings on POST_KERNEL step

This commit is contained in:
ggrocer 2025-12-29 13:23:30 +03:00
parent 40e06f3c00
commit fcec2125c0
1 changed files with 11 additions and 5 deletions

View File

@ -17,16 +17,22 @@ LOG_MODULE_REGISTER(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/display.h>
#include <lvgl.h>
#endif
#if IS_ENABLED(CONFIG_SETTINGS)
static int settings_init(const struct device *dev) {
ARG_UNUSED(dev);
settings_subsys_init();
settings_load();
return 0;
}
SYS_INIT(settings_init, POST_KERNEL, 0);
#endif
int main(void) {
LOG_INF("Welcome to ZMK!\n");
#if IS_ENABLED(CONFIG_SETTINGS)
settings_subsys_init();
settings_load();
#endif
#ifdef CONFIG_ZMK_DISPLAY
zmk_display_init();