diff --git a/docs/boards/MAMBAH743_2022B.md b/docs/boards/MAMBAH743_2022B.md index 688c630cb84..d3d91e14c14 100644 --- a/docs/boards/MAMBAH743_2022B.md +++ b/docs/boards/MAMBAH743_2022B.md @@ -2,4 +2,8 @@ Contrary to what the documentation suggests, VTX power is actually on USER2. +# Dual Gyros + +INAV 7.1 changed the default gyro of the board from the gyro on SPI4 back to the one on SPI1. A new tagrt ```MAMBAH743_2022B_GYRO2``` was added to use gyro on SPI4, in case you suspect an issue with the gyro on SPI1, you can switch to the gyro on SPI4 by using the new target. + diff --git a/src/main/target/MAMBAH743/CMakeLists.txt b/src/main/target/MAMBAH743/CMakeLists.txt index 61b073da931..801467cdb86 100644 --- a/src/main/target/MAMBAH743/CMakeLists.txt +++ b/src/main/target/MAMBAH743/CMakeLists.txt @@ -1,2 +1,3 @@ target_stm32h743xi(MAMBAH743) -target_stm32h743xi(MAMBAH743_2022B) \ No newline at end of file +target_stm32h743xi(MAMBAH743_2022B) +target_stm32h743xi(MAMBAH743_2022B_GYRO2) diff --git a/src/main/target/MAMBAH743/target.c b/src/main/target/MAMBAH743/target.c index 46231fdbd79..1e4f8fe246b 100644 --- a/src/main/target/MAMBAH743/target.c +++ b/src/main/target/MAMBAH743/target.c @@ -29,7 +29,7 @@ BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000, DEVHW_MPU6000, MPU6000_SPI_BUS, MPU6000_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_MPU6000_ALIGN); BUSDEV_REGISTER_SPI_TAG(busdev_bmi270, DEVHW_BMI270, BMI270_SPI_BUS, BMI270_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_BMI270_ALIGN); -#ifdef MAMBAH743_2022B +#ifdef USE_IMU_ICM42605 BUSDEV_REGISTER_SPI_TAG(busdev_icm42605, DEVHW_ICM42605, ICM42605_SPI_BUS, ICM42605_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_ICM42605_ALIGN); #endif diff --git a/src/main/target/MAMBAH743/target.h b/src/main/target/MAMBAH743/target.h index 7fcea85f48b..bc4a73979ee 100644 --- a/src/main/target/MAMBAH743/target.h +++ b/src/main/target/MAMBAH743/target.h @@ -22,6 +22,11 @@ #define TARGET_BOARD_IDENTIFIER "M743" #define USBD_PRODUCT_STRING "MAMBAH743_2022B" +#elif defined(MAMBAH743_2022B_GYRO2) + +#define TARGET_BOARD_IDENTIFIER "M743" +#define USBD_PRODUCT_STRING "MAMBAH743_2022B_GYRO2" + #else #define TARGET_BOARD_IDENTIFIER "M743" @@ -58,13 +63,22 @@ #define BMI270_SPI_BUS BUS_SPI1 #define BMI270_CS_PIN PA4 -#ifdef MAMBAH743_2022B - #define USE_SPI_DEVICE_4 #define SPI4_SCK_PIN PE12 #define SPI4_MISO_PIN PE13 #define SPI4_MOSI_PIN PE14 +#ifdef MAMBAH743_2022B + +#define USE_IMU_ICM42605 +#define IMU_ICM42605_ALIGN CW0_DEG +#define ICM42605_SPI_BUS BUS_SPI1 +#define ICM42605_CS_PIN PA4 + +#endif + +#ifdef MAMBAH743_2022B_GYRO2 + #define USE_IMU_ICM42605 #define IMU_ICM42605_ALIGN CW270_DEG #define ICM42605_SPI_BUS BUS_SPI4 @@ -175,7 +189,7 @@ #define USE_ADC #define ADC_INSTANCE ADC3 -#ifdef MAMBAH743_2022B +#if defined(MAMBAH743_2022B) || defined(MAMBAH743_2022B_GYRO2) #define ADC_CHANNEL_1_PIN PC1 #define ADC_CHANNEL_2_PIN PC3 @@ -203,7 +217,7 @@ #define USE_PINIO #define USE_PINIOBOX -#ifdef MAMBAH743_2022B +#if defined(MAMBAH743_2022B) || defined(MAMBAH743_2022B_GYRO2) #define PINIO1_PIN PC2 #define PINIO2_PIN PC5