X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_mpu6000.c;h=e5594a662c6dfcb62f6d11e0acd1a78565bd2ce1;hb=a724a6b223229f8640740874523aee394350e9c6;hp=79658c552bf2e38b7c917d287523f148df86d271;hpb=8a830c7f9ed41565c72edb85852e2df8bfa351f5;p=fw%2Faltos diff --git a/src/drivers/ao_mpu6000.c b/src/drivers/ao_mpu6000.c index 79658c55..e5594a66 100644 --- a/src/drivers/ao_mpu6000.c +++ b/src/drivers/ao_mpu6000.c @@ -32,7 +32,7 @@ static uint8_t ao_mpu6000_configured; #if AO_MPU6000_SPI -#define AO_MPU6000_SPI_SPEED ao_spi_speed(1000000) /* 1Mhz for all register access */ +#define AO_MPU6000_SPI_SPEED ao_spi_speed(AO_MPU6000_SPI_BUS, 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) @@ -113,7 +113,7 @@ _ao_mpu6000_sample(struct ao_mpu6000_sample *sample) /* byte swap */ while (i--) { uint16_t t = *d; - *d++ = (t >> 8) | (t << 8); + *d++ = (uint16_t) ((t >> 8) | (t << 8)); } #endif }