summaryrefslogtreecommitdiff
path: root/fw/app/src/settings.c
blob: 799322e304b5f4cd53f12dc40fcca8edff9962d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at https://mozilla.org/MPL/2.0/.
 */


#include <zephyr/init.h>
#include <zephyr/logging/log.h>
#include <zephyr/settings/settings.h>


LOG_MODULE_DECLARE(settings);


int init_settings(void) {
	int ret = settings_subsys_init();
	if (ret < 0) {
		LOG_ERR("Subsystem init failed (%d)", ret);
		return ret;
	}
	LOG_INF("Subsystem initialized");

	ret = settings_load();
	if (ret < 0) {
		LOG_ERR("Failed to load settings (%d)", ret);
		return ret;
	}
	LOG_INF("Loaded settings");

	return 0;
}
SYS_INIT(init_settings, APPLICATION, 50);