Start rc.baseboard

This commit is contained in:
alexklimaj 2022-10-01 11:46:35 -06:00
parent 2bd1ac005f
commit 673e5898ea
5 changed files with 101 additions and 128 deletions

View File

@ -39,6 +39,7 @@ px4_add_romfs_files(
rc.balloon_apps
rc.balloon_defaults
rc.boat_defaults
rc.baseboard
rc.fw_apps
rc.fw_defaults
rc.heli_defaults

View File

@ -0,0 +1,65 @@
#!/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

View File

@ -2,12 +2,7 @@
#
# ARK FMUARKV6X specific board sensors init
#------------------------------------------------------------------------------
set HAVE_PM2 yes
if ver hwtypecmp ARKV6X005000 ARKV6X005001 ARKV6X005002 ARKV6X005003 ARKV6X005004
then
set HAVE_PM2 no
fi
if param compare -s ADC_ADS1115_EN 1
then
ads1115 start -X
@ -15,38 +10,6 @@ else
board_adc start
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
# Internal SPI bus IIM42652
iim42652 -R 3 -s -b 1 start
@ -59,13 +22,18 @@ icm42688p -R 6 -s -b 3 start
# Internal magnetometer on I2c
bmm150 -I start
# 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
# Possible internal Baro
bmp388 -I start
# Baro on I2C3
ms5611 -X start
#
# baseboard sensors: rc.baseboard
#
set BASEBOARD_SENSORS ${R}etc/init.d/rc.baseboard
if [ -f $BASEBOARD_SENSORS ]
then
echo "Baseboard sensors: ${BASEBOARD_SENSORS}"
. $BASEBOARD_SENSORS
fi
unset BASEBOARD_SENSORS
unset HAVE_PM2
. ${R}etc/init.d/rc.baseboard

View File

@ -3,12 +3,6 @@
# PX4 FMUv5X specific board sensors init
#------------------------------------------------------------------------------
set HAVE_PM2 yes
if ver hwtypecmp V5X005000 V5X005001 V5X005002
then
set HAVE_PM2 no
fi
if param compare -s ADC_ADS1115_EN 1
then
ads1115 start -X
@ -17,38 +11,6 @@ else
board_adc start
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
if ver hwtypecmp V5X000000 V5X000001 V5X000002 V5X001000 V5X004000 V5X004001 V5X004002 V5X005001 V5X005002
then
#FMUv5Xbase board orientation
@ -96,9 +58,6 @@ else
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
# Possible internal Baro
# Disable startup of internal baros if param is set to false
@ -113,4 +72,16 @@ then
fi
fi
unset HAVE_PM2
#
# baseboard sensors: rc.baseboard
#
set BASEBOARD_SENSORS ${R}etc/init.d/rc.baseboard
if [ -f $BASEBOARD_SENSORS ]
then
echo "Baseboard sensors: ${BASEBOARD_SENSORS}"
. $BASEBOARD_SENSORS
fi
unset BASEBOARD_SENSORS
. ${R}etc/init.d/rc.baseboard

View File

@ -2,12 +2,7 @@
#
# PX4 FMUv6X specific board sensors init
#------------------------------------------------------------------------------
set HAVE_PM2 yes
if ver hwtypecmp V6X005000 V6X005001 V6X005003 V6X005004
then
set HAVE_PM2 no
fi
if param compare -s ADC_ADS1115_EN 1
then
ads1115 start -X
@ -15,38 +10,6 @@ else
board_adc start
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
if ver hwtypecmp V6X000004 V6X001004 V6X004004 V6X005004
then
# Internal SPI bus ICM20649
@ -77,9 +40,6 @@ else
bmm150 -I start
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
# Possible internal Baro
if ver hwtypecmp V6X002001
then
@ -100,7 +60,15 @@ else
fi
fi
# Baro on I2C3
ms5611 -X start
#
# baseboard sensors: rc.baseboard
#
set BASEBOARD_SENSORS ${R}etc/init.d/rc.baseboard
if [ -f $BASEBOARD_SENSORS ]
then
echo "Baseboard sensors: ${BASEBOARD_SENSORS}"
. $BASEBOARD_SENSORS
fi
unset BASEBOARD_SENSORS
unset HAVE_PM2
. ${R}etc/init.d/rc.baseboard