From: Keith Packard Date: Tue, 7 Sep 2021 14:54:01 +0000 (-0700) Subject: Show mag sensor SPI ID X-Git-Tag: 1.9.8~1^2~32 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=98e54df2385fcaf263de14f89a1f0728bfdd541a Show mag sensor SPI ID --- diff --git a/src/drivers/ao_mmc5983.c b/src/drivers/ao_mmc5983.c index 81bf8f2b..7160ea1a 100644 --- a/src/drivers/ao_mmc5983.c +++ b/src/drivers/ao_mmc5983.c @@ -89,11 +89,11 @@ ao_mmc5983_sample(struct ao_mmc5983_sample *sample) sample->z = raw.z0 << 10 | raw.z1 << 2 | ((raw.xyz2 >> 2) & 3); } +static uint8_t product_id; + static uint8_t ao_mmc5983_setup(void) { - uint8_t product_id; - if (ao_mmc5983_configured) return 1; @@ -143,8 +143,8 @@ static struct ao_task ao_mmc5983_task; static void ao_mmc5983_show(void) { - printf ("X: %d Z: %d Y: %d\n", - ao_mmc5983_current.x, ao_mmc5983_current.z, ao_mmc5983_current.y); + printf ("X: %d Z: %d Y: %d id %d\n", + ao_mmc5983_current.x, ao_mmc5983_current.z, ao_mmc5983_current.y, product_id); } static const struct ao_cmds ao_mmc5983_cmds[] = {