Skip to content

Commit

Permalink
fmu-6x: Use i2c_launcher by default
Browse files Browse the repository at this point in the history
This switches all SENS_EN_INAXXX params to 0 by default and instead uses
the i2c_launcher command.

However, if any one the SENS_EN_INAXXX param is set, it no longer tries
to auto-configure it.

Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes authored and dagar committed Nov 23, 2023
1 parent fbc95ff commit 19964d5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion boards/px4/fmu-v6x/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ CONFIG_SYSTEMCMDS_BSONDUMP=y
CONFIG_SYSTEMCMDS_DMESG=y
CONFIG_SYSTEMCMDS_GPIO=y
CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_I2C_LAUNCHER=y
CONFIG_USER_I2C_LAUNCHER=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_LED_CONTROL=y
CONFIG_SYSTEMCMDS_MFT=y
CONFIG_SYSTEMCMDS_MTD=y
Expand Down
4 changes: 3 additions & 1 deletion boards/px4/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ param set-default MAV_2_RATE 100000
param set-default MAV_2_REMOTE_PRT 14550
param set-default MAV_2_UDP_PRT 14550

# By disabling all 3 INA modules, we use the
# i2c_launcher instead.
param set-default SENS_EN_INA238 0
param set-default SENS_EN_INA228 0
param set-default SENS_EN_INA226 1
param set-default SENS_EN_INA226 0

if ver hwtypecmp V6X009010 V6X010010
then
Expand Down
19 changes: 15 additions & 4 deletions boards/px4/fmu-v6x/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# PX4 FMUv6X specific board sensors init
#------------------------------------------------------------------------------
set HAVE_PM2 yes
set INA_CONFIGURED no

if ver hwtypecmp V6X005000 V6X005001 V6X005003 V6X005004
then
Expand All @@ -25,6 +26,8 @@ then
then
ina226 -X -b 2 -t 2 -k start
fi

set INA_CONFIGURED yes
fi

if param compare SENS_EN_INA228 1
Expand All @@ -35,6 +38,8 @@ then
then
ina228 -X -b 2 -t 2 -k start
fi

set INA_CONFIGURED yes
fi

if param compare SENS_EN_INA238 1
Expand All @@ -45,18 +50,23 @@ then
then
ina238 -X -b 2 -t 2 -k start
fi

set INA_CONFIGURED yes
fi

#Start Auterion Power Module selector for Skynode boards
if ver hwtypecmp V6X009010 V6X010010
then
pm_selector_auterion start
else
# INA226, INA228, INA238 auto-start
i2c_launcher start -b 1
if [ $HAVE_PM2 = yes ]
if [ $INA_CONFIGURED = no ]
then
i2c_launcher start -b 2
# INA226, INA228, INA238 auto-start
i2c_launcher start -b 1
if [ $HAVE_PM2 = yes ]
then
i2c_launcher start -b 2
fi
fi
fi

Expand Down Expand Up @@ -151,4 +161,5 @@ fi
# Baro on I2C3
ms5611 -X start

unset INA_CONFIGURED
unset HAVE_PM2
2 changes: 1 addition & 1 deletion boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKPRIORITY=50
CONFIG_SCHED_LPWORKSTACKSIZE=1632
CONFIG_SCHED_WAITPID=y
CONFIG_SDMMC2_SDIO_PULLUP=y
CONFIG_SEM_PREALLOCHOLDERS=32
CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y
Expand Down Expand Up @@ -287,6 +286,7 @@ CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_DHCPC_RENEW=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_SYSTEM_SYSTEM=y
CONFIG_TASK_NAME_SIZE=24
CONFIG_UART4_BAUD=57600
CONFIG_UART4_RXBUFSIZE=600
Expand Down

0 comments on commit 19964d5

Please sign in to comment.