2018-12-14 12:36:32 -05:00
|
|
|
#!/bin/sh
|
2018-11-30 14:05:31 -05:00
|
|
|
#
|
2018-12-14 12:36:32 -05:00
|
|
|
# PX4 FMUv4 specific board sensors init
|
2018-11-30 14:05:31 -05:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
2020-09-08 11:09:20 +08:00
|
|
|
board_adc start
|
2019-11-11 15:35:59 -05:00
|
|
|
|
2018-11-30 14:05:31 -05:00
|
|
|
# We know there are sketchy boards out there
|
|
|
|
|
# as chinese companies produce Pixracers without
|
|
|
|
|
# fully understanding the critical parts of the
|
|
|
|
|
# schematic and BOM, leading to sensor brownouts
|
|
|
|
|
# on boot. Original Pixracers following the
|
|
|
|
|
# open hardware design do not require this.
|
2020-04-11 14:18:55 -04:00
|
|
|
pwm_out sensor_reset 50
|
2018-11-30 14:05:31 -05:00
|
|
|
|
2019-09-01 19:55:50 +03:00
|
|
|
# Internal SPI
|
|
|
|
|
ms5611 -s start
|
|
|
|
|
|
2018-11-30 14:05:31 -05:00
|
|
|
# hmc5883 internal SPI bus is rotated 90 deg yaw
|
2020-04-09 14:44:34 -04:00
|
|
|
if ! hmc5883 -T -s -R 2 start
|
2018-11-30 14:05:31 -05:00
|
|
|
then
|
|
|
|
|
# lis3mdl internal SPI bus is rotated 90 deg yaw
|
2020-03-17 18:08:17 +01:00
|
|
|
lis3mdl -s start
|
2018-11-30 14:05:31 -05:00
|
|
|
fi
|
|
|
|
|
|
2019-11-11 16:04:10 -05:00
|
|
|
# Start either ICM2060X. They are both connected to the same SPI bus and use the same
|
2018-11-30 14:05:31 -05:00
|
|
|
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
|
|
|
|
|
# will prevent the incorrect driver from a successful initialization.
|
|
|
|
|
|
2020-03-25 01:07:33 -04:00
|
|
|
# ICM20602 internal SPI bus ICM-20608-G
|
2020-03-11 19:00:54 +01:00
|
|
|
if ! icm20602 -s -R 8 start
|
2018-11-30 14:05:31 -05:00
|
|
|
then
|
2020-03-25 01:07:33 -04:00
|
|
|
# ICM20608 internal SPI bus ICM-20602-G
|
2020-03-18 17:43:48 +01:00
|
|
|
icm20608g -s -R 8 start
|
2018-11-30 14:05:31 -05:00
|
|
|
fi
|
|
|
|
|
|
2020-03-13 15:02:39 +01:00
|
|
|
# For Teal One airframe
|
|
|
|
|
if param compare SYS_AUTOSTART 4250
|
|
|
|
|
then
|
2020-03-25 01:07:33 -04:00
|
|
|
mpu6500 -s -R 0 start
|
2020-03-13 15:02:39 +01:00
|
|
|
else
|
2020-03-25 01:07:33 -04:00
|
|
|
# mpu9250 internal SPI bus mpu9250
|
|
|
|
|
mpu9250 -s -R 8 start
|
2020-03-13 15:02:39 +01:00
|
|
|
fi
|