summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-05-14 10:36:17 -0700
committerKeith Packard <keithp@keithp.com>2013-05-14 10:36:17 -0700
commit72a52875e55fef30d3cddf1fe4ee707088c2c150 (patch)
treecb3b681b652185e51fb27a8246f54f2004e399b2
parentd4433ae7bed92503db65a60cc1bdc97ea7334444 (diff)
altos: Initialize MPU6000 CS pin for SPI mode
Without this, we can't talk to the chip very well Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/drivers/ao_mpu6000.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/ao_mpu6000.c b/src/drivers/ao_mpu6000.c
index 9bb99132..fb2d54c0 100644
--- a/src/drivers/ao_mpu6000.c
+++ b/src/drivers/ao_mpu6000.c
@@ -331,6 +331,9 @@ ao_mpu6000_init(void)
ao_mpu6000_configured = 0;
// ao_add_task(&ao_mpu6000_task, ao_mpu6000, "mpu6000");
+#ifndef AO_MPU6000_I2C_INDEX
+ ao_spi_init_cs(AO_MPU6000_SPI_CS_PORT, (1 << AO_MPU6000_SPI_CS_PIN));
+#endif
ao_cmd_register(&ao_mpu6000_cmds[0]);
}
#endif