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:
+14
-1
@@ -42,7 +42,7 @@ typedef struct {
|
||||
bool enable_triple;
|
||||
} bma456_tap_config_t;
|
||||
|
||||
/** Edit these values to tune tap detection, then rebuild. */
|
||||
/** Edit these values for the compile-time default (overridden by NVS if set). */
|
||||
#define BMA456_TAP_CONFIG_DEFAULT \
|
||||
{ \
|
||||
.tap_sens_thres = 5, /* sensitive; 0=max, Bosch default=9 */ \
|
||||
@@ -56,6 +56,19 @@ typedef struct {
|
||||
.enable_triple = true, \
|
||||
}
|
||||
|
||||
/** True if cfg fields are within sensor limits and at least one tap kind is on. */
|
||||
bool bma456_tap_config_valid(const bma456_tap_config_t *cfg);
|
||||
|
||||
/** Copy current runtime tap config (compile default until set/NVS-applied). */
|
||||
void bma456_get_tap_config(bma456_tap_config_t *cfg_out);
|
||||
|
||||
/**
|
||||
* Apply tap config to the sensor (and keep RAM copy).
|
||||
* Returns ESP_ERR_INVALID_ARG if invalid. When the sensor is not ready, only
|
||||
* the RAM copy is updated (ESP_OK).
|
||||
*/
|
||||
esp_err_t bma456_set_tap_config(const bma456_tap_config_t *cfg);
|
||||
|
||||
/**
|
||||
* Probe and configure the sensor on bus_handle (100 kHz device).
|
||||
* On failure the device is removed and ESP_ERR_NOT_FOUND / ESP_FAIL is returned;
|
||||
|
||||
Reference in New Issue
Block a user