From b08f20806bbff7718b5fbc8ad2c58421d0ed3550 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Mon, 11 Oct 2021 12:51:24 -0400 Subject: [PATCH] ROMFS: rcS don't play startup tune until after UAVCAN and px4io - fixes potential duplicate startup tune --- ROMFS/px4fmu_common/init.d/rcS | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/rcS b/ROMFS/px4fmu_common/init.d/rcS index 34aa64f5d4..e5e3c50754 100644 --- a/ROMFS/px4fmu_common/init.d/rcS +++ b/ROMFS/px4fmu_common/init.d/rcS @@ -97,8 +97,7 @@ if [ $SDCARD_AVAILABLE = yes ] then if hardfault_log check then - # Error tune. - set STARTUP_TUNE 2 + set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE if hardfault_log commit then hardfault_log reset @@ -182,15 +181,6 @@ else # tone_alarm start - # - # Play the startup tune (if not disabled or there is an error) - # - param compare CBRK_BUZZER 782090 - if [ $? != 0 -o $STARTUP_TUNE != 1 ] - then - tune_control play -t $STARTUP_TUNE - fi - # # Waypoint storage. # REBOOTWORK this needs to start in parallel. @@ -250,7 +240,7 @@ else then # Start UAVCAN firmware update server and dynamic node ID allocation server. uavcan start fw - tune_control play -t 1 + if param greater UAVCAN_ENABLE 2 then set OUTPUT_MODE uavcan_esc @@ -315,7 +305,7 @@ else if [ $USE_IO = yes -a $IO_PRESENT = no ] then echo "PX4IO not found" - tune_control play error + set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE fi # @@ -369,6 +359,17 @@ else commander start fi + + # + # Play the startup tune (if not disabled or there is an error) + # + param compare CBRK_BUZZER 782090 + if [ $? != 0 -o $STARTUP_TUNE != 1 ] + then + tune_control play -t $STARTUP_TUNE + fi + + # Pre-takeoff continuous magnetometer calibration if param compare -s MBE_ENABLE 1 then