projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
micropeak: Use a menu for 'Download' on Mac OS X
[fw/altos]
/
src
/
drivers
/
ao_mpu6000.c
diff --git
a/src/drivers/ao_mpu6000.c
b/src/drivers/ao_mpu6000.c
index 8c85ab01fd82c00041128a9147e3f6a26f2caa39..7c9d6b6bffaa343469576c4429bf4d883fad69d5 100644
(file)
--- a/
src/drivers/ao_mpu6000.c
+++ b/
src/drivers/ao_mpu6000.c
@@
-32,7
+32,9
@@
static uint8_t ao_mpu6000_configured;
#if AO_MPU6000_SPI
#if AO_MPU6000_SPI
-#define ao_mpu6000_spi_get() ao_spi_get(AO_MPU6000_SPI_BUS, AO_SPI_SPEED_1MHz)
+#define AO_MPU6000_SPI_SPEED ao_spi_speed(1000000) /* 1Mhz for all register access */
+
+#define ao_mpu6000_spi_get() ao_spi_get(AO_MPU6000_SPI_BUS, AO_MPU6000_SPI_SPEED)
#define ao_mpu6000_spi_put() ao_spi_put(AO_MPU6000_SPI_BUS)
#define ao_mpu6000_spi_start() ao_spi_set_cs(AO_MPU6000_SPI_CS_PORT, \
#define ao_mpu6000_spi_put() ao_spi_put(AO_MPU6000_SPI_BUS)
#define ao_mpu6000_spi_start() ao_spi_set_cs(AO_MPU6000_SPI_CS_PORT, \
@@
-305,7
+307,7
@@
_ao_mpu6000_setup(void)
}
if (st_tries == ST_TRIES)
}
if (st_tries == ST_TRIES)
-
ao_sensor_errors = 1
;
+
AO_SENSOR_ERROR(AO_DATA_MPU6000)
;
/* Filter to about 100Hz, which also sets the gyro rate to 1000Hz */
_ao_mpu6000_reg_write(MPU6000_CONFIG,
/* Filter to about 100Hz, which also sets the gyro rate to 1000Hz */
_ao_mpu6000_reg_write(MPU6000_CONFIG,
@@
-383,7
+385,7
@@
ao_mpu6000_init(void)
*/
ao_cur_task = &ao_mpu6000_task;
*/
ao_cur_task = &ao_mpu6000_task;
- ao_
spi_get(AO_MPU6000_SPI_BUS, AO_SPI_SPEED_1MHz
);
+ ao_
mpu6000_spi_get(
);
ao_cur_task = NULL;
#endif
ao_cur_task = NULL;
#endif