altos: Initialize MPU6000 CS pin for SPI mode
authorKeith Packard <keithp@keithp.com>
Tue, 14 May 2013 17:36:17 +0000 (10:36 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 14 May 2013 17:36:17 +0000 (10:36 -0700)
Without this, we can't talk to the chip very well

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_mpu6000.c

index 9bb99132d3b9b182276e4cb7a48e355df74d674c..fb2d54c03a162da20b22599bb84a4152db62b5f0 100644 (file)
@@ -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