From dd69427cbfb47bcab10d64055faf3e8d2d4e4930 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 10 Aug 2018 12:54:18 -0700 Subject: [PATCH] rc.io:Add USE_IO == yes && IO_PRESENT == yes test On a FMU without a px4io (FMUv4, NXPhlite etc), this code should not be run. --- ROMFS/px4fmu_common/init.d/rc.io | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.io b/ROMFS/px4fmu_common/init.d/rc.io index 54948b697d..454d1a0f8d 100644 --- a/ROMFS/px4fmu_common/init.d/rc.io +++ b/ROMFS/px4fmu_common/init.d/rc.io @@ -2,15 +2,17 @@ # # PX4IO interface init script. # - -if px4io start +if [ $USE_IO == yes -a $IO_PRESENT == yes ] then - # Allow PX4IO to recover from midair restarts. - px4io recovery - - # Adjust PX4IO update rate limit. - px4io limit 400 -else - echo "PX4IO start failed" >> $LOG_FILE - tune_control play -m ${TUNE_ERR} + if px4io start + then + # Allow PX4IO to recover from midair restarts. + px4io recovery + + # Adjust PX4IO update rate limit. + px4io limit 400 + else + echo "PX4IO start failed" >> $LOG_FILE + tune_control play -m ${TUNE_ERR} + fi fi