Add accelerometer deadzone via UART and ESP-NOW.
Filter BMA456 logs by configurable LSB threshold; master can set deadzone for local sensor or slaves using ACCEL_DEADZONE (UART) and ESP-NOW broadcast until unicast delivery is restored. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,8 +19,12 @@ typedef struct {
|
||||
/** Milliseconds since boot when last heartbeat / SLAVE_INFO was accepted. */
|
||||
uint32_t last_success_ping_at;
|
||||
uint32_t version;
|
||||
/** Accel deadzone in raw LSB per axis (master copy for ESP-NOW config). */
|
||||
uint32_t accel_deadzone;
|
||||
} client_info_t;
|
||||
|
||||
#define CLIENT_REGISTRY_DEFAULT_ACCEL_DEADZONE 100u
|
||||
|
||||
void client_registry_init(void);
|
||||
|
||||
/** Milliseconds since boot (same clock as stored ping timestamps). */
|
||||
@@ -49,5 +53,14 @@ void client_registry_check_timeouts(uint32_t timeout_ms);
|
||||
size_t client_registry_count(void);
|
||||
const client_info_t *client_registry_at(size_t index);
|
||||
const client_info_t *client_registry_find_by_mac(const uint8_t mac[CLIENT_MAC_LEN]);
|
||||
const client_info_t *client_registry_find_by_id(uint32_t id);
|
||||
|
||||
esp_err_t client_registry_set_accel_deadzone(uint32_t client_id,
|
||||
uint32_t deadzone);
|
||||
esp_err_t client_registry_get_accel_deadzone(uint32_t client_id,
|
||||
uint32_t *deadzone_out);
|
||||
|
||||
/** Push deadzone to all active registry entries; returns count updated. */
|
||||
size_t client_registry_set_accel_deadzone_all(uint32_t deadzone);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user