diff options
Diffstat (limited to 'ROMFS/px4fmu_common/init.d/rc.sensors')
-rw-r--r-- | ROMFS/px4fmu_common/init.d/rc.sensors | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index be54ea98b..121dc89d3 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -6,28 +6,45 @@ ms5611 start adc start -# Mag might be external -if hmc5883 start +if mpu6000 start then - echo "[init] Using HMC5883" + echo "Internal MPU6000" fi -if mpu6000 start +if l3gd20 start then - echo "[init] Using MPU6000" + echo "Internal L3GD20(H)" fi -if l3gd20 start +# MAG selection +if param compare SENS_EXT_MAG 2 then - echo "[init] Using L3GD20(H)" + if hmc5883 -I start + then + echo "Internal HMC5883" + fi +else + # Use only external as primary + if param compare SENS_EXT_MAG 1 + then + if hmc5883 -X start + then + echo "External HMC5883" + fi + else + # auto-detect the primary, prefer external + if hmc5883 start + then + echo "Default HMC5883" + fi + fi fi if ver hwcmp PX4FMU_V2 then - # IMPORTANT: EXTERNAL BUSES SHOULD BE SCANNED FIRST if lsm303d start then - echo "[init] Using LSM303D" + echo "Internal LSM303D" fi fi |