Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/target/OMNIBUSF4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ target_stm32f405xg(OMNIBUSF4V3_S6_SS)
# OMNIBUSF4V3 is a (almost identical) variant of OMNIBUSF4PRO target,
# except for an inverter on UART6.
target_stm32f405xg(OMNIBUSF4V3)
target_stm32f405xg(OMNIBUSF4V3_ICM SKIP_RELEASES)
31 changes: 20 additions & 11 deletions src/main/target/OMNIBUSF4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define TARGET_BOARD_IDENTIFIER "OBSD"
#elif defined(OMNIBUSF4V3)
#define TARGET_BOARD_IDENTIFIER "OB43"
#elif defined(OMNIBUSF4V3_ICM)
#define TARGET_BOARD_IDENTIFIER "OB4I"
#elif defined(DYSF4PRO)
#define TARGET_BOARD_IDENTIFIER "DYS4"
#elif defined(DYSF4PROV2)
Expand Down Expand Up @@ -67,16 +69,23 @@
#define MPU6000_CS_PIN PA4
#define MPU6000_SPI_BUS BUS_SPI1

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4V3_ICM)
#define USE_IMU_ICM42605
#define IMU_ICM42605_ALIGN CW180_DEG
#define ICM42605_CS_PIN PA4
#define ICM42605_SPI_BUS BUS_SPI1
#endif

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define USE_IMU_MPU6000
#define IMU_MPU6000_ALIGN CW270_DEG
#else
#define USE_IMU_MPU6000
#define IMU_MPU6000_ALIGN CW180_DEG
#endif

// Support for OMNIBUS F4 PRO CORNER - it has ICM20608 instead of MPU6000
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
// Support for OMNIBUS F4 PRO CORNER - it has MPU6500/ICM20608 instead of MPU6000
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define MPU6500_CS_PIN MPU6000_CS_PIN
#define MPU6500_SPI_BUS MPU6000_SPI_BUS
#define USE_IMU_MPU6500
Comment on lines +72 to 91
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: To resolve a hardware conflict, remove the OMNIBUSF4V3_ICM target from the preprocessor conditions for the MPU6000, MPU6500, and BMI270 IMUs, as it should only use the ICM42605 IMU. [possible issue, importance: 9]

New proposed code:
 #if defined(OMNIBUSF4V3_ICM)
   #define USE_IMU_ICM42605
   #define IMU_ICM42605_ALIGN      CW180_DEG
   #define ICM42605_CS_PIN         PA4
   #define ICM42605_SPI_BUS        BUS_SPI1
 #endif
 
-#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
+#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
   #define USE_IMU_MPU6000
   #define IMU_MPU6000_ALIGN       CW270_DEG
 #else
 ...
 #endif
 
 // Support for OMNIBUS F4 PRO CORNER - it has MPU6500/ICM20608 instead of MPU6000
-#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
+#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
   #define MPU6500_CS_PIN          MPU6000_CS_PIN
   #define MPU6500_SPI_BUS         MPU6000_SPI_BUS
   #define USE_IMU_MPU6500
   #define IMU_MPU6500_ALIGN       IMU_MPU6000_ALIGN
 
   //BMI270
   #define USE_IMU_BMI270
   #define IMU_BMI270_ALIGN        IMU_MPU6000_ALIGN
   #define BMI270_SPI_BUS          MPU6000_SPI_BUS
   #define BMI270_CS_PIN           MPU6000_CS_PIN
 #endif

Expand All @@ -97,7 +106,7 @@

#define USE_BARO

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define USE_BARO_BMP280
#define BMP280_SPI_BUS BUS_SPI3
#define BMP280_CS_PIN PB3 // v1
Expand All @@ -121,7 +130,7 @@
#define VBUS_SENSING_PIN PC5
#define VBUS_SENSING_ENABLED

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define USE_UART_INVERTER
#endif

Expand All @@ -140,12 +149,12 @@
#define USE_UART6
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#if defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define INVERTER_PIN_UART6_RX PC8
#define INVERTER_PIN_UART6_TX PC9
#endif

#if defined(OMNIBUSF4V3) && !(defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS))
#if (defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)) && !(defined(OMNIBUSF4V3_S6_SS) || defined(OMNIBUSF4V3_S5S6_SS) || defined(OMNIBUSF4V3_S5_S6_2SS))
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PC6 // shared with UART6 TX
#define SOFTSERIAL_1_TX_PIN PC6 // shared with UART6 TX
Expand Down Expand Up @@ -193,7 +202,7 @@

#define USE_SPI_DEVICE_1

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define USE_SPI_DEVICE_2
#define SPI2_NSS_PIN PB12
#define SPI2_SCK_PIN PB13
Expand All @@ -202,7 +211,7 @@
#endif

#define USE_SPI_DEVICE_3
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define SPI3_NSS_PIN PA15
#else
#define SPI3_NSS_PIN PB3
Expand All @@ -215,7 +224,7 @@
#define MAX7456_SPI_BUS BUS_SPI3
#define MAX7456_CS_PIN PA15

#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
#define USE_SDCARD
#define USE_SDCARD_SPI
Expand Down Expand Up @@ -250,7 +259,7 @@
#define SENSORS_SET (SENSOR_ACC|SENSOR_MAG|SENSOR_BARO)

#define USE_LED_STRIP
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
#if (defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3) || defined(OMNIBUSF4V3_ICM)) && !defined(OMNIBUSF4PRO_LEDSTRIPM5)
#define WS2811_PIN PB6
#else
#define WS2811_PIN PA1
Expand Down