Persist accelerometer deadzone in NVS across reboots.

Each node saves its local deadzone on UART or ESP-NOW set; pod_settings loads and applies it after BMA456 init.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-19 22:29:00 +02:00
co-authored by Cursor
parent 2e88358c53
commit 5c3cf65bca
7 changed files with 158 additions and 16 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef POD_SETTINGS_H
#define POD_SETTINGS_H
#include "esp_err.h"
#include <stdint.h>
/** Initialize NVS (idempotent) and log stored settings. Call once early in app_main. */
esp_err_t pod_settings_init(void);
/** Persist local accelerometer deadzone (LSB per axis). */
esp_err_t pod_settings_save_accel_deadzone(uint32_t deadzone_lsb);
/** Load deadzone from NVS, or BMA456_DEFAULT_ACCEL_DEADZONE if unset. */
uint32_t pod_settings_load_accel_deadzone(void);
/** Apply NVS deadzone to BMA456 when the sensor is present. */
void pod_settings_apply_accel_deadzone(void);
#endif