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
+7
View File
@@ -22,6 +22,7 @@
#include "board_input.h"
#include "bosch456.h"
#include "led_ring.h"
#include "pod_settings.h"
#include "uart.h"
#include <stdint.h>
@@ -66,6 +67,10 @@ uint8_t reverse_high_nibble_lut(uint8_t n) {
}
void app_main(void) {
if (pod_settings_init() != ESP_OK) {
ESP_LOGW(TAG, "settings NVS init failed; using defaults");
}
// Get Master Mode Pin
gpio_reset_pin(DIP_MASTER);
gpio_set_direction(DIP_MASTER, GPIO_MODE_INPUT);
@@ -125,6 +130,8 @@ void app_main(void) {
esp_err_t bma_err = init_bma456(bus_handle);
if (bma_err != ESP_OK) {
ESP_LOGI(TAG, "BMA456 init skipped: %s", esp_err_to_name(bma_err));
} else {
pod_settings_apply_accel_deadzone();
}
}