From fc4f86810a05abd03e6ab200585f3efc15b9ceeb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 14 May 2013 21:55:59 -0700 Subject: [PATCH] altos: mpu6000 was getting spi mutex twice 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 --- src/drivers/ao_mpu6000.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/drivers/ao_mpu6000.c b/src/drivers/ao_mpu6000.c index 5cb423fc..ef08bfd4 100644 --- a/src/drivers/ao_mpu6000.c +++ b/src/drivers/ao_mpu6000.c @@ -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 -- 2.47.2