mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 16:46:09 +08:00
Alphabetize hardware type logic blocks and sensor specific logic blocks in rc.sensors.
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
set BOARD_FMUV3 0
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Begin Setup for board specific configurations. #
|
# Begin Setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -105,6 +108,20 @@ then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ver hwcmp MINDPX_V2
|
||||||
|
then
|
||||||
|
# External I2C bus
|
||||||
|
hmc5883 -C -T -X start
|
||||||
|
|
||||||
|
# Internal I2C bus
|
||||||
|
hmc5883 -C -T -I -R 12 start
|
||||||
|
|
||||||
|
mpu6000 -s -R 8 start
|
||||||
|
mpu9250 -s -R 8 start
|
||||||
|
lsm303d -R 10 start
|
||||||
|
l3gd20 -R 14 start
|
||||||
|
fi
|
||||||
|
|
||||||
if ver hwcmp NXPHLITE_V3
|
if ver hwcmp NXPHLITE_V3
|
||||||
then
|
then
|
||||||
# External I2C bus
|
# External I2C bus
|
||||||
@@ -123,8 +140,21 @@ then
|
|||||||
fxas21002c start -R 0
|
fxas21002c start -R 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# V2 build hwtypecmp is always false
|
if ver hwcmp OMNIBUS_F4SD
|
||||||
set BOARD_FMUV3 0
|
then
|
||||||
|
if ! mpu6000 -R 12 -s start
|
||||||
|
then
|
||||||
|
# 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
|
||||||
|
|
||||||
|
bmp280 start
|
||||||
|
|
||||||
|
adc start
|
||||||
|
fi
|
||||||
|
|
||||||
if ver hwcmp PX4FMU_V2
|
if ver hwcmp PX4FMU_V2
|
||||||
then
|
then
|
||||||
@@ -222,15 +252,6 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ver hwcmp PX4_SAME70XPLAINED_V1
|
|
||||||
then
|
|
||||||
# External I2C bus
|
|
||||||
hmc5883 -C -T -X start
|
|
||||||
|
|
||||||
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
|
||||||
mpu9250 -R 2 start
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ver hwcmp PX4FMU_V4
|
if ver hwcmp PX4FMU_V4
|
||||||
then
|
then
|
||||||
# External I2C bus
|
# External I2C bus
|
||||||
@@ -279,36 +300,6 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ver hwcmp MINDPX_V2
|
|
||||||
then
|
|
||||||
# External I2C bus
|
|
||||||
hmc5883 -C -T -X start
|
|
||||||
|
|
||||||
# Internal I2C bus
|
|
||||||
hmc5883 -C -T -I -R 12 start
|
|
||||||
|
|
||||||
mpu6000 -s -R 8 start
|
|
||||||
mpu9250 -s -R 8 start
|
|
||||||
lsm303d -R 10 start
|
|
||||||
l3gd20 -R 14 start
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ver hwcmp OMNIBUS_F4SD
|
|
||||||
then
|
|
||||||
if ! mpu6000 -R 12 -s start
|
|
||||||
then
|
|
||||||
# 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
|
|
||||||
|
|
||||||
bmp280 start
|
|
||||||
|
|
||||||
adc start
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ver hwcmp PX4FMU_V4PRO
|
if ver hwcmp PX4FMU_V4PRO
|
||||||
then
|
then
|
||||||
# Internal SPI bus ICM-20608-G
|
# Internal SPI bus ICM-20608-G
|
||||||
@@ -349,7 +340,6 @@ then
|
|||||||
hmc5883 -C -T -X start
|
hmc5883 -C -T -X start
|
||||||
|
|
||||||
# Possible external compasses
|
# Possible external compasses
|
||||||
|
|
||||||
ist8310 -C -b 1 start
|
ist8310 -C -b 1 start
|
||||||
ist8310 -C -b 2 start
|
ist8310 -C -b 2 start
|
||||||
|
|
||||||
@@ -357,6 +347,15 @@ then
|
|||||||
ist8310 -C -b 5 start
|
ist8310 -C -b 5 start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ver hwcmp PX4_SAME70XPLAINED_V1
|
||||||
|
then
|
||||||
|
# External I2C bus
|
||||||
|
hmc5883 -C -T -X start
|
||||||
|
|
||||||
|
# Internal SPI bus mpu9250 is rotated 90 deg yaw
|
||||||
|
mpu9250 -R 2 start
|
||||||
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# End Setup for board specific configurations. #
|
# End Setup for board specific configurations. #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -389,12 +388,6 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Heater driver for temperature regulated IMUs.
|
|
||||||
if param compare SENS_EN_THERMAL 1
|
|
||||||
then
|
|
||||||
heater start
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Sensors on the PWM interface bank
|
# Sensors on the PWM interface bank
|
||||||
if param compare SENS_EN_LL40LS 1
|
if param compare SENS_EN_LL40LS 1
|
||||||
then
|
then
|
||||||
@@ -410,6 +403,12 @@ then
|
|||||||
ll40ls start i2c
|
ll40ls start i2c
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# mb12xx sonar sensor
|
||||||
|
if param greater SENS_EN_MB12XX 0
|
||||||
|
then
|
||||||
|
mb12xx start -a
|
||||||
|
fi
|
||||||
|
|
||||||
# pga460 sonar sensor
|
# pga460 sonar sensor
|
||||||
if param greater SENS_EN_PGA460 0
|
if param greater SENS_EN_PGA460 0
|
||||||
then
|
then
|
||||||
@@ -428,10 +427,10 @@ then
|
|||||||
sf1xx start -a
|
sf1xx start -a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# mb12xx sonar sensor
|
# Heater driver for temperature regulated IMUs.
|
||||||
if param greater SENS_EN_MB12XX 0
|
if param compare SENS_EN_THERMAL 1
|
||||||
then
|
then
|
||||||
mb12xx start -a
|
heater start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Teraranger one tof sensor
|
# Teraranger one tof sensor
|
||||||
|
|||||||
Reference in New Issue
Block a user