summaryrefslogtreecommitdiff
path: root/fw/app/src/boot-count.c
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2025-04-13 08:27:20 +0200
committerxengineering <me@xengineering.eu>2025-04-14 18:08:45 +0200
commit25ee335a500dcfe7cdca6fb2ced658e0f423fbf8 (patch)
tree36d24be912c82d88ac32ce31e0b9fc3f84e4ea11 /fw/app/src/boot-count.c
parent015972d873627466bd7e40f8d5dbb5951fb0f36a (diff)
downloadiot-contact-25ee335a500dcfe7cdca6fb2ced658e0f423fbf8.tar
iot-contact-25ee335a500dcfe7cdca6fb2ced658e0f423fbf8.tar.zst
iot-contact-25ee335a500dcfe7cdca6fb2ced658e0f423fbf8.zip
fw: app: Enable settings with NVS backend
Diffstat (limited to 'fw/app/src/boot-count.c')
-rw-r--r--fw/app/src/boot-count.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fw/app/src/boot-count.c b/fw/app/src/boot-count.c
new file mode 100644
index 0000000..0b944e2
--- /dev/null
+++ b/fw/app/src/boot-count.c
@@ -0,0 +1,26 @@
+/*
+ * 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_REGISTER(boot_count);
+
+
+int init_settings(void) {
+ int ret = settings_subsys_init();
+ if (ret < 0) {
+ LOG_ERR("Failed to init settings subsystem (%d)", ret);
+ return ret;
+ }
+ LOG_INF("Settings subsystem initialized");
+
+ return 0;
+}
+SYS_INIT(init_settings, APPLICATION, 50);