Add runtime BMA456 tap config with NVS persistence and goTool UI.
Expose multitap parameters over UART/ESP-NOW (like deadzone), store per node in NVS, and allow get/set from CLI, REST, and the dashboard without poll-overwrite while editing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define CLIENT_REGISTRY_H
|
||||
|
||||
#include "board_input.h"
|
||||
#include "bosch456.h"
|
||||
#include "esp_err.h"
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -22,6 +23,8 @@ typedef struct {
|
||||
uint32_t version;
|
||||
/** Accel deadzone in raw LSB per axis (master copy for ESP-NOW config). */
|
||||
uint32_t accel_deadzone;
|
||||
/** Tap detection config (master copy for ESP-NOW / UART read). */
|
||||
bma456_tap_config_t tap_config;
|
||||
/** Latest accel from slave ESP-NOW stream (master only). */
|
||||
bool accel_valid;
|
||||
int16_t accel_x;
|
||||
@@ -88,6 +91,12 @@ esp_err_t client_registry_get_accel_deadzone(uint32_t client_id,
|
||||
/** Push deadzone to all active registry entries; returns count updated. */
|
||||
size_t client_registry_set_accel_deadzone_all(uint32_t deadzone);
|
||||
|
||||
esp_err_t client_registry_set_tap_config(uint32_t client_id,
|
||||
const bma456_tap_config_t *cfg);
|
||||
esp_err_t client_registry_get_tap_config(uint32_t client_id,
|
||||
bma456_tap_config_t *cfg_out);
|
||||
size_t client_registry_set_tap_config_all(const bma456_tap_config_t *cfg);
|
||||
|
||||
/** Store latest accel sample from a slave (matched by sender MAC). */
|
||||
esp_err_t client_registry_update_accel(const uint8_t mac[CLIENT_MAC_LEN],
|
||||
uint32_t slave_id, int16_t x, int16_t y,
|
||||
|
||||
Reference in New Issue
Block a user