diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 6ea7947151..0e0041223a 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -274,37 +274,39 @@ else . $FCONFIG fi - # Check if PX4IO present and update firmware if needed. - if [ -f $IOFW ] + if px4io supported then - if ! px4io checkcrc ${IOFW} + # Check if PX4IO present and update firmware if needed. + if [ -f $IOFW ] then - # tune Program PX4IO - tune_control play -t 16 # tune 16 = PROG_PX4IO - - if px4io update ${IOFW} + if ! px4io checkcrc ${IOFW} then - usleep 10000 - tune_control stop - if px4io checkcrc ${IOFW} + # tune Program PX4IO + tune_control play -t 16 # tune 16 = PROG_PX4IO + + if px4io update ${IOFW} then - tune_control play -t 17 # tune 17 = PROG_PX4IO_OK + usleep 10000 + tune_control stop + if px4io checkcrc ${IOFW} + then + tune_control play -t 17 # tune 17 = PROG_PX4IO_OK + else + tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR + fi else - tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR + tune_control stop fi - else - tune_control stop + fi + + if ! px4io start + then + echo "PX4IO start failed" + set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE fi fi - - if ! px4io start - then - echo "PX4IO start failed" - set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE - fi fi - # # RC update (map raw RC input to calibrate manual control) # start before commander diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 3e24fc48ba..be7a763672 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1556,6 +1556,10 @@ int PX4IO::custom_command(int argc, char *argv[]) { const char *verb = argv[0]; + if (!strcmp(verb, "supported")) { + return 0; + } + if (!strcmp(verb, "checkcrc")) { if (is_running()) { PX4_ERR("io must be stopped");