From 9918ff9bd43493d59e4bc40b74adc624acc9eb26 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 6 Aug 2015 00:12:14 +0200 Subject: [PATCH] Fix AUX ports, still retain successful boot for systems without IO --- ROMFS/px4fmu_common/init.d/rc.interface | 25 +++++++++++++------------ ROMFS/px4fmu_common/init.d/rcS | 14 +++++++------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.interface b/ROMFS/px4fmu_common/init.d/rc.interface index 571e808b6f..61abda3427 100644 --- a/ROMFS/px4fmu_common/init.d/rc.interface +++ b/ROMFS/px4fmu_common/init.d/rc.interface @@ -97,14 +97,6 @@ then fi fi -# check if should load secondary mixer -set OUTPUT_AUX_DEV /dev/pwm_output1 -if [ -f $OUTPUT_AUX_DEV ] -then -else - set MIXER_AUX none -fi - if [ $MIXER_AUX != none ] then # @@ -112,6 +104,7 @@ then # set MIXER_AUX_FILE none + set OUTPUT_AUX_DEV /dev/pwm_output1 if [ -f $SDCARD_MIXERS_PATH/$MIXER_AUX.aux.mix ] then @@ -128,16 +121,24 @@ then then if fmu mode_pwm then - if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE + if [ -f $OUTPUT_AUX_DEV ] then - echo "[i] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV" + if mixer load $OUTPUT_AUX_DEV $MIXER_AUX_FILE + then + echo "[i] Mixer: $MIXER_AUX_FILE on $OUTPUT_AUX_DEV" + else + echo "[i] Error loading mixer: $MIXER_AUX_FILE" + echo "ERROR: Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE + fi else - echo "[i] Error loading mixer: $MIXER_AUX_FILE" - echo "ERROR: Could not load mixer: $MIXER_AUX_FILE" >> $LOG_FILE + set PWM_AUX_OUT none + set FAILSAFE_AUX none fi else echo "ERROR: Could not start: fmu mode_pwm" >> $LOG_FILE tone_alarm $TUNE_ERR + set PWM_AUX_OUT none + set FAILSAFE_AUX none fi if [ $PWM_AUX_OUT != none ] diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 608ac95ef9..ad9a311ab4 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -694,13 +694,6 @@ then fi unset FEXTRAS - if [ $EXIT_ON_END == yes ] - then - echo "Exit from nsh" - exit - fi - unset EXIT_ON_END - # Run no SD alarm if [ $LOG_FILE == /dev/null ] then @@ -712,6 +705,13 @@ then # Boot is complete, inform MAVLink app(s) that the system is now fully up and running mavlink boot_complete + if [ $EXIT_ON_END == yes ] + then + echo "Exit from nsh" + exit + fi + unset EXIT_ON_END + # End of autostart fi