Skip to content

Commit b08f208

Browse files
committed
ROMFS: rcS don't play startup tune until after UAVCAN and px4io
- fixes potential duplicate startup tune
1 parent 6e3e684 commit b08f208

File tree

1 file changed

+14
-13
lines changed
  • ROMFS/px4fmu_common/init.d

1 file changed

+14
-13
lines changed

ROMFS/px4fmu_common/init.d/rcS

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ if [ $SDCARD_AVAILABLE = yes ]
9797
then
9898
if hardfault_log check
9999
then
100-
# Error tune.
101-
set STARTUP_TUNE 2
100+
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
102101
if hardfault_log commit
103102
then
104103
hardfault_log reset
@@ -182,15 +181,6 @@ else
182181
#
183182
tone_alarm start
184183

185-
#
186-
# Play the startup tune (if not disabled or there is an error)
187-
#
188-
param compare CBRK_BUZZER 782090
189-
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
190-
then
191-
tune_control play -t $STARTUP_TUNE
192-
fi
193-
194184
#
195185
# Waypoint storage.
196186
# REBOOTWORK this needs to start in parallel.
@@ -250,7 +240,7 @@ else
250240
then
251241
# Start UAVCAN firmware update server and dynamic node ID allocation server.
252242
uavcan start fw
253-
tune_control play -t 1
243+
254244
if param greater UAVCAN_ENABLE 2
255245
then
256246
set OUTPUT_MODE uavcan_esc
@@ -315,7 +305,7 @@ else
315305
if [ $USE_IO = yes -a $IO_PRESENT = no ]
316306
then
317307
echo "PX4IO not found"
318-
tune_control play error
308+
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
319309
fi
320310

321311
#
@@ -369,6 +359,17 @@ else
369359
commander start
370360
fi
371361

362+
363+
#
364+
# Play the startup tune (if not disabled or there is an error)
365+
#
366+
param compare CBRK_BUZZER 782090
367+
if [ $? != 0 -o $STARTUP_TUNE != 1 ]
368+
then
369+
tune_control play -t $STARTUP_TUNE
370+
fi
371+
372+
372373
# Pre-takeoff continuous magnetometer calibration
373374
if param compare -s MBE_ENABLE 1
374375
then

0 commit comments

Comments
 (0)