From 136f035f238b1b288cb3c146c3a527808ebaad64 Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Mon, 28 Aug 2023 14:09:14 -0500 Subject: [PATCH] BMI270 - fix detect fixes requirement for mpu6000 defines --- src/main/drivers/accgyro/accgyro_spi_bmi270.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/drivers/accgyro/accgyro_spi_bmi270.c b/src/main/drivers/accgyro/accgyro_spi_bmi270.c index 69a5d3bcc2..83168ff581 100644 --- a/src/main/drivers/accgyro/accgyro_spi_bmi270.c +++ b/src/main/drivers/accgyro/accgyro_spi_bmi270.c @@ -594,6 +594,12 @@ static void bmi270EnableSPI(const busDevice_t *bus) uint8_t bmi270Detect(const busDevice_t *bus) { +#ifndef USE_DUAL_GYRO + IOInit(bus->busdev_u.spi.csnPin, OWNER_MPU_CS, 0); + IOConfigGPIO(bus->busdev_u.spi.csnPin, SPI_IO_CS_CFG); + IOHi(bus->busdev_u.spi.csnPin); +#endif + spiSetDivisor(bus->busdev_u.spi.instance, spiCalculateDivider(BMI270_MAX_SPI_CLK_HZ)); bmi270EnableSPI(bus);