#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(1000000) /* 1MHz max SCLK */
#endif
#define ao_mpu9250_spi_get() ao_spi_get(AO_MPU9250_SPI_BUS, AO_MPU9250_SPI_SPEED)
/* 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
}