aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_logging
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-12-20 14:25:35 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-20 14:25:35 +0100
commit8c518aa23710ba0b9ad0c7ad2c03428ce8ddb290 (patch)
tree9cae6f445e759d2c5684564876e420e6355ef532 /ROMFS/px4fmu_logging
parent6dce57170e3ceaa3316446086f8a0cd12cc5e90c (diff)
downloadpx4-firmware-8c518aa23710ba0b9ad0c7ad2c03428ce8ddb290.tar.gz
px4-firmware-8c518aa23710ba0b9ad0c7ad2c03428ce8ddb290.tar.bz2
px4-firmware-8c518aa23710ba0b9ad0c7ad2c03428ce8ddb290.zip
Useful bits for high-rate logging
Diffstat (limited to 'ROMFS/px4fmu_logging')
-rw-r--r--ROMFS/px4fmu_logging/init.d/rcS88
1 files changed, 88 insertions, 0 deletions
diff --git a/ROMFS/px4fmu_logging/init.d/rcS b/ROMFS/px4fmu_logging/init.d/rcS
new file mode 100644
index 000000000..7b8856719
--- /dev/null
+++ b/ROMFS/px4fmu_logging/init.d/rcS
@@ -0,0 +1,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 \ No newline at end of file