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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user