Browse Source

Add support for Pixhack detection

This allows to boot a Pixhack 3.0 which is the same as Pixhawk 2.0 / 2.1
sbg
Lorenz Meier 7 years ago
parent
commit
59f56f4a5b
  1. 25
      ROMFS/px4fmu_common/init.d/rc.sensors

25
ROMFS/px4fmu_common/init.d/rc.sensors

@ -69,6 +69,9 @@ fi @@ -69,6 +69,9 @@ fi
if ver hwcmp PX4FMU_V2
then
# V2 build hwtypecmp is always false
set BOARD_FMUV3 0
# External I2C bus
hmc5883 -C -T -X start
lis3mdl -X start
@ -79,8 +82,6 @@ then @@ -79,8 +82,6 @@ then
# Internal SPI bus ICM-20608-G
mpu6000 -T 20608 start
# V2 build hwtypecmp is always false
set BOARD_FMUV3 0
# V3 build hwtypecmp supports V2|V2M|V30
if ver hwtypecmp V30
then
@ -99,6 +100,26 @@ then @@ -99,6 +100,26 @@ then
fi
fi
# Check if a Pixhack (which reports as V2M) is present
if ver hwtypecmp V2M
then
# Pixhawk Mini doesn't have these sensors,
# so if they are found we know its a Pixhack
# external MPU6K is rotated 180 degrees yaw
if mpu6000 -S -R 4 start
then
set BOARD_FMUV3 20
else
# Check for Pixhack 3.1
# external MPU9250 is rotated 180 degrees yaw
if mpu9250 -S -R 4 start
then
set BOARD_FMUV3 21
fi
fi
fi
if [ $BOARD_FMUV3 != 0 ]
then
# sensor heating is available, but we disable it for now

Loading…
Cancel
Save