Add UART ACCEL_READ command for on-demand BMA456 samples.

Expose MessageType 24 with protobuf response (success, x, y, z in raw LSB),
firmware handler with mutex-safe I2C read, goTool `accel` CLI, and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-28 19:55:02 +02:00
co-authored by Cursor
parent 16c521f71c
commit ba20544762
16 changed files with 479 additions and 99 deletions
+4 -1
View File
@@ -16,6 +16,7 @@ func usage() {
fmt.Fprintf(os.Stderr, " version firmware version and git hash\n")
fmt.Fprintf(os.Stderr, " clients registered ESP-NOW slaves on the master\n")
fmt.Fprintf(os.Stderr, " deadzone get/set accelerometer deadzone (LSB)\n")
fmt.Fprintf(os.Stderr, " accel read current accelerometer XYZ (raw LSB)\n")
fmt.Fprintf(os.Stderr, " unicast-test send ESP-NOW unicast test to one slave\n")
fmt.Fprintf(os.Stderr, " test run automated scenario (see testdata/)\n")
fmt.Fprintf(os.Stderr, " serve web dashboard (Bootstrap + WebSocket)\n")
@@ -50,7 +51,7 @@ func main() {
os.Exit(2)
}
runErr = runServe(*portName, *baud, flag.Args()[1:])
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "unicast-test", "unicast_test", "led-ring", "led_ring", "find-me", "find_me", "restart", "ota", "ota-progress", "ota_progress":
case "version", "clients", "client-info", "deadzone", "accel-deadzone", "accel", "accel-read", "accel_read", "unicast-test", "unicast_test", "led-ring", "led_ring", "find-me", "find_me", "restart", "ota", "ota-progress", "ota_progress":
if *portName == "" {
fmt.Fprintf(os.Stderr, "command %q requires -port\n\n", cmd)
usage()
@@ -68,6 +69,8 @@ func main() {
runErr = runClients(sp)
case "deadzone", "accel-deadzone":
runErr = runDeadzone(sp, flag.Args()[1:])
case "accel", "accel-read", "accel_read":
runErr = runAccel(sp)
case "unicast-test", "unicast_test":
runErr = runUnicastTest(sp, flag.Args()[1:])
case "led-ring", "led_ring":