summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-05-14 21:55:59 -0700
committerKeith Packard <keithp@keithp.com>2013-05-14 21:55:59 -0700
commitfc4f86810a05abd03e6ab200585f3efc15b9ceeb (patch)
tree704192e91805b8afdf48bbed63a5876d1826b7a8
parent604165a950f07afec8efe0a201435a3559b0d54d (diff)
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 <keithp@keithp.com>
-rw-r--r--src/drivers/ao_mpu6000.c16
1 files 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