aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_logging/init.d/rcS
blob: 7b885671978898e1344a89000dd10f0b616817e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!nsh
#
# PX4FMU startup script for logging purposes
#

#
# Try to mount the microSD card.
#
echo "[init] looking for microSD..."
if mount -t vfat /dev/mmcsd0 /fs/microsd
then
	echo "[init] card mounted at /fs/microsd"
	# Start playing the startup tune
	tone_alarm start
else
	echo "[init] no microSD card found"
	# Play SOS
	tone_alarm error
fi

uorb start

#
# Start sensor drivers here.
#

ms5611 start
adc start

# mag might be external
if hmc5883 start
then
	echo "using HMC5883"
fi

if mpu6000 start
then
	echo "using MPU6000"
fi

if l3gd20 start
then
	echo "using L3GD20(H)"
fi

if lsm303d start
then
	set BOARD fmuv2
else
	set BOARD fmuv1
fi

# Start airspeed sensors
if meas_airspeed start
then
	echo "using MEAS airspeed sensor"
else
	if ets_airspeed start
	then
		echo "using ETS airspeed sensor (bus 3)"
	else
		if ets_airspeed start -b 1
		then
			echo "Using ETS airspeed sensor (bus 1)"
		fi
	fi
fi

#
# Start the sensor collection task.
# IMPORTANT: this also loads param offsets
# ALWAYS start this task before the
# preflight_check.
#
if sensors start
then
	echo "SENSORS STARTED"
fi

sdlog2 start -r 250 -e -b 16

if sercon
then
	echo "[init] USB interface connected"

	# Try to get an USB console
	nshterm /dev/ttyACM0 &
fi