From: Keith Packard Date: Wed, 15 May 2013 04:55:59 +0000 (-0700) Subject: altos: mpu6000 was getting spi mutex twice X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=inline;h=fc4f86810a05abd03e6ab200585f3efc15b9ceeb;p=fw%2Faltos 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 --- 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