From 62a2351a7261ec8e428a1d9331871aeb8e80a09d Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 10 Aug 2017 08:31:54 -1000 Subject: [PATCH] ROMFS:Removed FMUv1 from rcS etal --- ROMFS/px4fmu_common/init.d/rc.interface | 4 - ROMFS/px4fmu_common/init.d/rc.io | 4 - ROMFS/px4fmu_common/init.d/rc.sensors | 94 ++++------ ROMFS/px4fmu_common/init.d/rcS | 226 ++++++++++-------------- ROMFS/px4fmu_test/init.d/rc.sensors | 62 ++----- 5 files changed, 133 insertions(+), 257 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rc.interface b/ROMFS/px4fmu_common/init.d/rc.interface index a4d7dfe618..77c83b9a2e 100644 --- a/ROMFS/px4fmu_common/init.d/rc.interface +++ b/ROMFS/px4fmu_common/init.d/rc.interface @@ -121,10 +121,6 @@ then fi # This is a FMUv2+ thing -if ver hwcmp PX4FMU_V1 -then - set MIXER_AUX none -fi #MindPX has not aux mixer if ver hwcmp MINDPX_V2 diff --git a/ROMFS/px4fmu_common/init.d/rc.io b/ROMFS/px4fmu_common/init.d/rc.io index 5b50676bcf..a729fdc313 100644 --- a/ROMFS/px4fmu_common/init.d/rc.io +++ b/ROMFS/px4fmu_common/init.d/rc.io @@ -11,10 +11,6 @@ px4io recovery # Adjust PX4IO update rate limit # set PX4IO_LIMIT 400 -if ver hwcmp PX4FMU_V1 -then - set PX4IO_LIMIT 200 -fi if px4io limit ${PX4IO_LIMIT} then diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 2931819793..389b16fc12 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -1,52 +1,42 @@ #!nsh # -# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers. +# Standard startup script for PX4FMU v2, v3, v4 onboard sensor drivers. # -if ver hwcmp PX4FMU_V1 -then - ms5611 start -else - if ver hwcmp AEROFC_V1 - then - # Aero FC uses separate driver - else - if ver hwcmp CRAZYFLIE - then - # Crazyflie uses separate driver - else - # Configure all I2C buses to 100 KHz as they - # are all external or slow - fmu i2c 1 100000 - fmu i2c 2 100000 - fi - - if ver hwcmp PX4FMU_V4 - then - # We know there are sketchy boards out there - # as chinese companies produce Pixracers without - # fully understanding the critical parts of the - # schematic and BOM, leading to sensor brownouts - # on boot. Original Pixracers following the - # open hardware design do not require this. - fmu sensor_reset 50 - fi - - # External SPI - ms5611 -S start - - # Internal SPI - ms5611 -s start - - # Blacksheep telemetry - bst start - fi -fi - if ver hwcmp AEROFC_V1 then # Aero FC uses separate driver else + if ver hwcmp CRAZYFLIE + then + # Crazyflie uses separate driver + else + # Configure all I2C buses to 100 KHz as they + # are all external or slow + fmu i2c 1 100000 + fmu i2c 2 100000 + fi + + if ver hwcmp PX4FMU_V4 + then + # We know there are sketchy boards out there + # as chinese companies produce Pixracers without + # fully understanding the critical parts of the + # schematic and BOM, leading to sensor brownouts + # on boot. Original Pixracers following the + # open hardware design do not require this. + fmu sensor_reset 50 + fi + + # External SPI + ms5611 -S start + + # Internal SPI + ms5611 -s start + + # Blacksheep telemetry + bst start + adc start fi @@ -184,28 +174,6 @@ then bmp280 -I start fi -if ver hwcmp PX4FMU_V1 -then - # FMUv1 - mpu6000 start - l3gd20 start - - # MAG selection - if param compare SENS_EXT_MAG 2 - then - hmc5883 -C -I start - else - # Use only external as primary - if param compare SENS_EXT_MAG 1 - then - hmc5883 -C -X start - else - # auto-detect the primary, prefer external - hmc5883 start - fi - fi -fi - if ver hwcmp MINDPX_V2 then # External I2C bus diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index a3ce3473a8..07e21fd337 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -13,7 +13,7 @@ set +e # # NOTE: COMMENT LINES ARE REMOVED BEFORE STORED IN ROMFS. # -# UART mapping on FMUv1/2/3/4: +# UART mapping on FMUv2/3/4: # # UART1 /dev/ttyS0 IO debug # USART2 /dev/ttyS1 TELEM1 (flow control) @@ -418,11 +418,6 @@ then # Need IO for output but it not present, disable output set OUTPUT_MODE none - # Avoid using ttyS0 for MAVLink on FMUv1 - if ver hwcmp PX4FMU_V1 - then - set FMU_MODE serial - fi fi if [ $OUTPUT_MODE == ardrone ] @@ -438,10 +433,6 @@ then if [ $HIL == yes ] then set OUTPUT_MODE hil - if ver hwcmp PX4FMU_V1 - then - set FMU_MODE serial - fi else gps start fi @@ -559,18 +550,6 @@ then echo "FMU start failed" >> $LOG_FILE tone_alarm $TUNE_ERR fi - - if ver hwcmp PX4FMU_V1 - then - if [ $FMU_MODE == pwm -o $FMU_MODE == gpio ] - then - set TTYS1_BUSY yes - fi - if [ $FMU_MODE == pwm_gpio -o $OUTPUT_MODE == ardrone ] - then - set TTYS1_BUSY yes - fi - fi fi if [ $OUTPUT_MODE == mkblctrl ] @@ -628,18 +607,6 @@ then echo "FMU mode_${FMU_MODE} start failed" >> $LOG_FILE tone_alarm $TUNE_ERR fi - - if ver hwcmp PX4FMU_V1 - then - if [ $FMU_MODE == pwm -o $FMU_MODE == gpio ] - then - set TTYS1_BUSY yes - fi - if [ $FMU_MODE == pwm_gpio -o $OUTPUT_MODE == ardrone ] - then - set TTYS1_BUSY yes - fi - fi fi fi fi @@ -687,69 +654,65 @@ then # # MAVLink onboard / TELEM2 # - if ver hwcmp PX4FMU_V1 + # XXX We need a better way for runtime eval of shell variables, + # but this works for now + if param compare SYS_COMPANION 10 then - else - # XXX We need a better way for runtime eval of shell variables, - # but this works for now - if param compare SYS_COMPANION 10 - then - frsky_telemetry start -d ${MAVLINK_COMPANION_DEVICE} - fi - if param compare SYS_COMPANION 20 - then - syslink start - mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000 - fi - if param compare SYS_COMPANION 921600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 921600 -m onboard -r 80000 -x -f - fi - if param compare SYS_COMPANION 57600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m onboard -r 5000 -x -f - fi - if param compare SYS_COMPANION 460800 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 460800 -m onboard -r 5000 -x -f - fi - if param compare SYS_COMPANION 157600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m osd -r 1000 - fi - if param compare SYS_COMPANION 257600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m magic -r 5000 -x -f - fi - if param compare SYS_COMPANION 319200 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 19200 -r 1000 - fi - if param compare SYS_COMPANION 338400 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 38400 -r 1000 - fi - if param compare SYS_COMPANION 357600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -r 1000 - fi - if param compare SYS_COMPANION 3115200 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 115200 -r 1000 - fi - if param compare SYS_COMPANION 419200 - then - iridiumsbd start -d /dev/ttyS2 - mavlink start -d /dev/iridium -b 19200 -m iridium -r 10 - fi - if param compare SYS_COMPANION 1921600 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 921600 -r 20000 - fi - if param compare SYS_COMPANION 1500000 - then - mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 1500000 -m onboard -r 10000 -x -f - fi + frsky_telemetry start -d ${MAVLINK_COMPANION_DEVICE} + fi + if param compare SYS_COMPANION 20 + then + syslink start + mavlink start -d /dev/bridge0 -b 57600 -m osd -r 40000 + fi + if param compare SYS_COMPANION 921600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 921600 -m onboard -r 80000 -x -f + fi + if param compare SYS_COMPANION 57600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m onboard -r 5000 -x -f + fi + if param compare SYS_COMPANION 460800 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 460800 -m onboard -r 5000 -x -f + fi + if param compare SYS_COMPANION 157600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m osd -r 1000 + fi + if param compare SYS_COMPANION 257600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -m magic -r 5000 -x -f + fi + if param compare SYS_COMPANION 319200 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 19200 -r 1000 + fi + if param compare SYS_COMPANION 338400 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 38400 -r 1000 + fi + if param compare SYS_COMPANION 357600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 57600 -r 1000 + fi + if param compare SYS_COMPANION 3115200 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 115200 -r 1000 + fi + if param compare SYS_COMPANION 419200 + then + iridiumsbd start -d /dev/ttyS2 + mavlink start -d /dev/iridium -b 19200 -m iridium -r 10 + fi + if param compare SYS_COMPANION 1921600 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 921600 -r 20000 + fi + if param compare SYS_COMPANION 1500000 + then + mavlink start -d ${MAVLINK_COMPANION_DEVICE} -b 1500000 -m onboard -r 10000 -x -f fi unset MAVLINK_COMPANION_DEVICE @@ -811,53 +774,46 @@ then # # Logging # - if ver hwcmp PX4FMU_V1 + if param compare SYS_LOGGER 0 then - if sdlog2 start -r 30 -a -b 2 -t + # check if we should increase logging rate for ekf2 replay message logging + if param greater EKF2_REC_RPL 0 then - fi - else - if param compare SYS_LOGGER 0 - then - # check if we should increase logging rate for ekf2 replay message logging - if param greater EKF2_REC_RPL 0 + if sdlog2 start -r 500 -e -b 18 -t then - if sdlog2 start -r 500 -e -b 18 -t - then - fi - else - if sdlog2 start -r 100 -a -b 9 -t - then - fi fi else - set LOGGER_ARGS "" - # - # Adjust FMUv5 logging settings - # - if ver hwcmp PX4FMU_V5 - then - set LOGGER_BUF 64 - param set SDLOG_MODE 2 - fi - if param compare SDLOG_MODE 1 - then - set LOGGER_ARGS "-e" - fi - if param compare SDLOG_MODE 2 - then - set LOGGER_ARGS "-f" - fi - if ver hwcmp AEROFC_V1 - then - set LOGGER_ARGS "-m mavlink" - fi - if logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS} + if sdlog2 start -r 100 -a -b 9 -t then fi - unset LOGGER_BUF - unset LOGGER_ARGS fi + else + set LOGGER_ARGS "" + # + # Adjust FMUv5 logging settings + # + if ver hwcmp PX4FMU_V5 + then + set LOGGER_BUF 64 + param set SDLOG_MODE 2 + fi + if param compare SDLOG_MODE 1 + then + set LOGGER_ARGS "-e" + fi + if param compare SDLOG_MODE 2 + then + set LOGGER_ARGS "-f" + fi + if ver hwcmp AEROFC_V1 + then + set LOGGER_ARGS "-m mavlink" + fi + if logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS} + then + fi + unset LOGGER_BUF + unset LOGGER_ARGS fi # diff --git a/ROMFS/px4fmu_test/init.d/rc.sensors b/ROMFS/px4fmu_test/init.d/rc.sensors index ad66a11610..dac49f865c 100644 --- a/ROMFS/px4fmu_test/init.d/rc.sensors +++ b/ROMFS/px4fmu_test/init.d/rc.sensors @@ -1,27 +1,20 @@ #!nsh # -# Standard startup script for PX4FMU v1, v2, v3, v4 onboard sensor drivers. +# Standard startup script for PX4FMU v2, v3, v4 onboard sensor drivers. # -if ver hwcmp PX4FMU_V1 +# Configure all I2C buses to 100 KHz as they +# are all external or slow +fmu i2c 1 100000 +fmu i2c 2 100000 + +if ms5611 -s start then - if ms5611 start - then - fi -else - # Configure all I2C buses to 100 KHz as they - # are all external or slow - fmu i2c 1 100000 - fmu i2c 2 100000 +fi - if ms5611 -s start - then - fi - - # Blacksheep telemetry - if bst start - then - fi +# Blacksheep telemetry +if bst start +then fi if adc start @@ -116,39 +109,6 @@ then fi fi -if ver hwcmp PX4FMU_V1 -then - # FMUv1 - if mpu6000 start - then - fi - - if l3gd20 start - then - fi - - # MAG selection - if param compare SENS_EXT_MAG 2 - then - if hmc5883 -C -I start - then - fi - else - # Use only external as primary - if param compare SENS_EXT_MAG 1 - then - if hmc5883 -C -X start - then - fi - else - # auto-detect the primary, prefer external - if hmc5883 start - then - fi - fi - fi -fi - if ver hwcmp MINDPX_V2 then # External I2C bus