From bc8dbe8a3347a4752ec3ff495593e1970d22c0c0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Fri, 7 Sep 2012 13:03:23 +0200 Subject: [PATCH] Start emergency only once --- src/uas/UAS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index fc633971a..134fcf69a 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -467,7 +467,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) audiostring += modeAudio + stateAudio + navModeAudio; } - if ((int)state.system_status == (int)MAV_STATE_CRITICAL || state.system_status == (int)MAV_STATE_EMERGENCY) + if (statechanged && ((int)state.system_status == (int)MAV_STATE_CRITICAL || state.system_status == (int)MAV_STATE_EMERGENCY)) { GAudioOutput::instance()->say(QString("emergency for system %1").arg(this->getUASID())); QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency())); -- 2.22.0