diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 562471d941b6..5583c1319994 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1159,6 +1159,8 @@ Commander::run() { bool sensor_fail_tune_played = false; bool arm_tune_played = false; + bool low_bat_tune_played = false; + bool crit_bat_tune_played = false; bool was_landed = true; bool was_falling = false; bool was_armed = false; @@ -2492,16 +2494,18 @@ Commander::run() set_tune(TONE_ARMING_WARNING_TUNE); arm_tune_played = true; - } else if (!status_flags.usb_connected && + } else if (!crit_bat_tune_played && !status_flags.usb_connected && (status.hil_state != vehicle_status_s::HIL_STATE_ON) && (_battery_warning == battery_status_s::BATTERY_WARNING_CRITICAL)) { /* play tune on battery critical */ set_tune(TONE_BATTERY_WARNING_FAST_TUNE); + crit_bat_tune_played = true; - } else if ((status.hil_state != vehicle_status_s::HIL_STATE_ON) && + } else if (!low_bat_tune_played && (status.hil_state != vehicle_status_s::HIL_STATE_ON) && (_battery_warning == battery_status_s::BATTERY_WARNING_LOW)) { /* play tune on battery warning */ set_tune(TONE_BATTERY_WARNING_SLOW_TUNE); + low_bat_tune_played = true; } else if (status.failsafe) { tune_failsafe(true);