zmk/app/src/settings/reset_settings_on_start.c
Peter Johanson 3a3eed2960 fix: Add settings reset on start init priority.
* Add a dedicated settings reset on start init priority and default
  it to lower priority (high number) than default FLASH_INIT_PRIORITY
  to be sure flash is initialized before we open the area.
2024-03-20 11:18:43 -07:00

13 lines
374 B
C

/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <zephyr/init.h>
#include <zmk/settings.h>
// Reset after the kernel is initialized but before any application code to
// ensure settings are cleared before anything tries to use them.
SYS_INIT(zmk_settings_erase, POST_KERNEL, CONFIG_ZMK_SETTINGS_RESET_ON_START_INIT_PRIORITY);