aboutsummaryrefslogtreecommitdiff
path: root/ROMFS/px4fmu_test
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-02-08 16:44:10 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-02-08 16:44:10 +0100
commit44fea268d92b718ab0473ecf96f003b04ce9e2aa (patch)
tree73116306ba1a5ea92fb685ba1a327df4e6cbb4cf /ROMFS/px4fmu_test
parenta4a3b1b25f8386390df7929448b23649ae55b107 (diff)
downloadpx4-firmware-44fea268d92b718ab0473ecf96f003b04ce9e2aa.tar.gz
px4-firmware-44fea268d92b718ab0473ecf96f003b04ce9e2aa.tar.bz2
px4-firmware-44fea268d92b718ab0473ecf96f003b04ce9e2aa.zip
ROMFS startup cleanup
Diffstat (limited to 'ROMFS/px4fmu_test')
-rw-r--r--ROMFS/px4fmu_test/init.d/rcS53
1 files changed, 32 insertions, 21 deletions
diff --git a/ROMFS/px4fmu_test/init.d/rcS b/ROMFS/px4fmu_test/init.d/rcS
index 3d1c4a907..1c66552f9 100644
--- a/ROMFS/px4fmu_test/init.d/rcS
+++ b/ROMFS/px4fmu_test/init.d/rcS
@@ -17,8 +17,8 @@ fi
#
# Try to mount the microSD card.
#
-echo "[i] looking for microSD..."
-if mount -t vfat /dev/mmcsd0 /fs/microsd
+mount -t vfat /dev/mmcsd0 /fs/microsd
+if [ $? == 0 ]
then
echo "[i] card mounted at /fs/microsd"
# Start playing the startup tune
@@ -40,7 +40,8 @@ else
set io_file /etc/extras/px4io-v1_default.bin
fi
-if px4io start
+px4io start
+if [ $? == 0 ]
then
echo "PX4IO OK"
else
@@ -48,7 +49,8 @@ else
set unit_test_failure_list "${unit_test_failure_list} px4io_start"
fi
-if px4io checkcrc $io_file
+px4io checkcrc $io_file
+if [ $? == 0 ]
then
echo "PX4IO CRC OK"
else
@@ -87,45 +89,52 @@ fi
# Add new unit tests using the same pattern as below.
#
-if mavlink_tests
+mavlink_tests
+if [ $? != 0 ]
then
-else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} mavlink_tests"
fi
-if commander_tests
+commander_tests
+if [ $? != 0 ]
then
-else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} commander_tests"
fi
-if uorb test
+uorb test
+if [ $? != 0 ]
then
-else
set unit_test_failure 1
set unit_test_failure_list "${unit_test_failure_list} uorb_tests"
fi
-if hmc5883 -I start
+adc start
+hmc5883 -I -S start
+if [ $? != 0 ]
then
- # This is an FMUv3
- echo "FMUv3"
+ # This is an FMUv1 or FMUv2
+ echo "FMUv2 (or FMUv3 where 'hmc5883 -I -S start' failed)"
ms5611 start
+ mpu6000 start
+ lsm303d start
+ l3gd20 start
+else
+ # This is a FMUv3
+ echo "FMUv3"
mpu6000 -X start
mpu6000 start
lsm303d -X start
l3gd20 -X start
- echo "EVALUATION ONLY SENSORS (not used in production)"
- ms5611 -X start
-else
- # This is an FMUv1 or FMUv2
- echo "FMUv2 (or FMUv3 where 'hmc5883 -I start' failed)"
ms5611 start
- mpu6000 start
- lsm303d start
- l3gd20 start
+fi
+
+tests all
+if [ $? != 0 ]
+then
+ set unit_test_failure 1
+ set unit_test_failure_list "${unit_test_failure_list} system_tests"
fi
if [ $unit_test_failure == 0 ]
@@ -136,3 +145,5 @@ else
echo
echo "Some Unit Tests FAILED:${unit_test_failure_list}"
fi
+
+ver all