From cc932973d61b343772457f5171773c7c00a139ce Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Mar 2013 14:59:58 +1100 Subject: [PATCH] HAL_PX4: remove the need for the fmu_only flag file --- libraries/AP_HAL_PX4/scripts/rc.APM | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/AP_HAL_PX4/scripts/rc.APM b/libraries/AP_HAL_PX4/scripts/rc.APM index 298ec16213..2c8938b40f 100644 --- a/libraries/AP_HAL_PX4/scripts/rc.APM +++ b/libraries/AP_HAL_PX4/scripts/rc.APM @@ -3,7 +3,6 @@ # APM startup script for NuttX on PX4 # To disable APM startup add a /fs/microsd/APM/nostart file -# To disable use of a PX4IO board add a file /fs/microsd/APM/fmu_only set deviceA /dev/ttyACM0 set deviceC /dev/ttyS1 @@ -53,6 +52,7 @@ then then echo "Created APM directory" fi + if [ -f /fs/microsd/px4io.bin ] then echo "Checking for new px4io firmware" @@ -79,8 +79,16 @@ then hmc5883 start adc start - if [ -f /fs/microsd/APM/fmu_only ] + echo "Trying PX4IO board" + if px4io start then + echo "PX4IO board OK" + echo "Loading FMU_pass mixer" + mixer load /dev/pwm_output /etc/mixers/FMU_pass.mix + echo "Setting FMU mode_serial" + fmu mode_serial + else + echo "No PX4IO board found" echo "Setting up PX4FMU direct mode" fmu mode_pwm if [ $deviceC == /dev/ttyS1 ] @@ -89,13 +97,6 @@ then # is no IO board set deviceC /dev/ttyS2 fi - else - echo "Setting up PX4IO board" - px4io start - echo "Loading FMU_pass mixer" - mixer load /dev/pwm_output /etc/mixers/FMU_pass.mix - echo "Setting FMU mode_serial" - fmu mode_serial fi echo Starting $sketch