altos: mpu6000 was getting spi mutex twice
authorKeith Packard <keithp@keithp.com>
Wed, 15 May 2013 04:55:59 +0000 (21:55 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 15 May 2013 04:55:59 +0000 (21:55 -0700)
Need to use ao_spi_set_cs and ao_spi_clr_cs now that the mutex is held
out side

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

index 5cb423fc9c872061bc2955cf403b08343b326838..ef08bfd47928ad7f9a13eb0999cc94703a7dc97e 100644 (file)
@@ -35,16 +35,12 @@ static uint8_t      ao_mpu6000_configured;
 #define ao_mpu6000_spi_get()   ao_spi_get(AO_MPU6000_SPI_BUS, AO_SPI_SPEED_1MHz)
 #define ao_mpu6000_spi_put()   ao_spi_put(AO_MPU6000_SPI_BUS)
 
-#define ao_mpu6000_spi_start()         ao_spi_get_bit(AO_MPU6000_SPI_CS_PORT,  \
-                                              AO_MPU6000_SPI_CS_PIN,   \
-                                              AO_MPU6000_SPI_CS,       \
-                                              AO_MPU6000_SPI_BUS,      \
-                                              AO_SPI_SPEED_1MHz)
-
-#define ao_mpu6000_spi_end()   ao_spi_put_bit(AO_MPU6000_SPI_CS_PORT,  \
-                                              AO_MPU6000_SPI_CS_PIN,   \
-                                              AO_MPU6000_SPI_CS,       \
-                                              AO_MPU6000_SPI_BUS)
+#define ao_mpu6000_spi_start()         ao_spi_set_cs(AO_MPU6000_SPI_CS_PORT,   \
+                                             (1 << AO_MPU6000_SPI_CS_PIN))
+
+#define ao_mpu6000_spi_end()   ao_spi_clr_cs(AO_MPU6000_SPI_CS_PORT,   \
+                                             (1 << AO_MPU6000_SPI_CS_PIN))
+
 #endif