X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_mpu9250.c;h=63d8d6d7fe31ffbc32dc8c786dc349df9bfee413;hb=5506b6c1f75d639e2d952213a53bc9ee34e5a79c;hp=0597a81c57fbc8677bc64d93002db7d0d0ca88b5;hpb=6363403d6c08310a16769bf49b8acc45a08bd619;p=fw%2Faltos diff --git a/src/drivers/ao_mpu9250.c b/src/drivers/ao_mpu9250.c index 0597a81c..63d8d6d7 100644 --- a/src/drivers/ao_mpu9250.c +++ b/src/drivers/ao_mpu9250.c @@ -35,7 +35,7 @@ static uint8_t ao_mpu9250_configured; #if AO_MPU9250_SPI #ifndef AO_MPU9250_SPI_SPEED -#define AO_MPU9250_SPI_SPEED AO_SPI_SPEED_1MHz +#define AO_MPU9250_SPI_SPEED ao_spi_speed(AO_MPU9250_SPI_BUS, 1000000) /* 1MHz max SCLK */ #endif #define ao_mpu9250_spi_get() ao_spi_get(AO_MPU9250_SPI_BUS, AO_MPU9250_SPI_SPEED) @@ -176,7 +176,7 @@ _ao_mpu9250_sample(struct ao_mpu9250_sample *sample) /* byte swap */ while (i--) { uint16_t t = *d; - *d++ = (t >> 8) | (t << 8); + *d++ = (uint16_t) ((uint16_t) (t >> 8) | (uint16_t) (t << 8)); } #endif }