From 3f03288a9544499d26d845ca3005bf9cfccf06dd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beat=20K=C3=BCng?= <beat-kueng@gmx.net>
Date: Mon, 23 Jul 2018 09:30:23 +0200
Subject: [PATCH] omnibus: add support for Hobbywing XRotor F4 G2

It has an ICM-20602 IMU
---
 ROMFS/px4fmu_common/init.d/rc.sensors          | 7 ++++++-
 src/drivers/boards/omnibus-f4sd/board_config.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors
index e770155f46..89bf091f79 100644
--- a/ROMFS/px4fmu_common/init.d/rc.sensors
+++ b/ROMFS/px4fmu_common/init.d/rc.sensors
@@ -297,7 +297,12 @@ fi
 
 if ver hwcmp OMNIBUS_F4SD
 then
-	mpu6000 -R 12 -s start
+	if mpu6000 -R 12 -s start
+	then
+	else
+		# some boards such as the Hobbywing XRotor F4 G2 use the ICM-20602
+		mpu6000 -R 12 -T 20602 -s start
+	fi
 
 	# Possible external compasses
 	hmc5883 -X start
diff --git a/src/drivers/boards/omnibus-f4sd/board_config.h b/src/drivers/boards/omnibus-f4sd/board_config.h
index f82c132987..4e9c40a435 100644
--- a/src/drivers/boards/omnibus-f4sd/board_config.h
+++ b/src/drivers/boards/omnibus-f4sd/board_config.h
@@ -172,6 +172,7 @@
 // One device per bus
 #define PX4_SPI_BUS_SENSORS         1
 #define PX4_SPIDEV_MPU              1
+#define PX4_SPIDEV_ICM_20602        1
 #define PX4_SPIDEV_BARO_BUS         3
 #define PX4_SPIDEV_BARO             1
 
-- 
GitLab