mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-11 03:51:36 +08:00
66 lines
1.3 KiB
Bash
66 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Standard startup script for baseboard sensor drivers.
|
|
#
|
|
###############################################################################
|
|
# Begin Baseboard drivers #
|
|
###############################################################################
|
|
|
|
set HAVE_PM2 yes
|
|
|
|
if ver hwtypecmp V6X005000 V6X005001 V6X005003 V6X005004
|
|
then
|
|
set HAVE_PM2 no
|
|
fi
|
|
|
|
if param compare SENS_EN_INA226 1
|
|
then
|
|
# Start Digital power monitors
|
|
ina226 -X -b 1 -t 1 -k start
|
|
|
|
if [ $HAVE_PM2 = yes ]
|
|
then
|
|
ina226 -X -b 2 -t 2 -k start
|
|
fi
|
|
fi
|
|
|
|
if param compare SENS_EN_INA228 1
|
|
then
|
|
# Start Digital power monitors
|
|
ina228 -X -b 1 -t 1 -k start
|
|
if [ $HAVE_PM2 = yes ]
|
|
then
|
|
ina228 -X -b 2 -t 2 -k start
|
|
fi
|
|
fi
|
|
|
|
if param compare SENS_EN_INA238 1
|
|
then
|
|
# Start Digital power monitors
|
|
ina238 -X -b 1 -t 1 -k start
|
|
if [ $HAVE_PM2 = yes ]
|
|
then
|
|
ina238 -X -b 2 -t 2 -k start
|
|
fi
|
|
fi
|
|
|
|
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
|
|
ist8310 -X -b 1 -R 10 start
|
|
|
|
if ver hwtypecmp V6X000000 V6X001000
|
|
then
|
|
bmp388 -I start
|
|
else
|
|
if ver hwtypecmp V6X002001
|
|
then
|
|
icp201xx -X start
|
|
else
|
|
bmp388 -X start
|
|
fi
|
|
fi
|
|
|
|
# Baro on I2C3
|
|
ms5611 -X start
|
|
|
|
unset HAVE_PM2
|