From 206f7cd2d5815ced82c6293be7b31203a23ac0c7 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 56fcebfb4c..db8a29f1ab 100644 --- a/src/main/drivers/accgyro/accgyro_spi_bmi270.c +++ b/src/main/drivers/accgyro/accgyro_spi_bmi270.c @@ -158,6 +158,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);