mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 04:01:37 +08:00
Give priority to power off tune over other tunes (e.g. Battery Low)
Make Power Off tune not interruptable This solves the case of Low Battery warning tune overriding the power off tune, as now the Power off tune is not interruptable by any other tune unless override flag is specified commander_helper: resolve "redundant boolean literal in ternary expression result"
This commit is contained in:
committed by
Matthias Grob
parent
652b153383
commit
f66c3914f6
@@ -107,13 +107,11 @@ static_assert(sizeof(actuator_armed_s) == 16, "actuator_armed equality operator
|
||||
|
||||
#if defined(BOARD_HAS_POWER_CONTROL)
|
||||
static orb_advert_t tune_control_pub = nullptr;
|
||||
|
||||
static void play_power_button_down_tune()
|
||||
{
|
||||
tune_control_s tune_control{};
|
||||
tune_control.volume = tune_control_s::VOLUME_LEVEL_DEFAULT;
|
||||
tune_control.tune_id = tune_control_s::TUNE_ID_POWER_OFF;
|
||||
tune_control.timestamp = hrt_absolute_time();
|
||||
orb_publish(ORB_ID(tune_control), tune_control_pub, &tune_control);
|
||||
// Override any other tunes because power-off sound should have the priority
|
||||
set_tune_override(tune_control_s::TUNE_ID_POWER_OFF);
|
||||
}
|
||||
|
||||
static void stop_tune()
|
||||
|
||||
Reference in New Issue
Block a user