Browse Source

Notify: add arming failure tone

mission-4.1.18
Jonathan Challinger 11 years ago committed by Randy Mackay
parent
commit
f0fc0397d3
  1. 1
      libraries/AP_Notify/AP_Notify.h
  2. 7
      libraries/AP_Notify/ToneAlarm_PX4.cpp
  3. 1
      libraries/AP_Notify/ToneAlarm_PX4.h

1
libraries/AP_Notify/AP_Notify.h

@ -42,6 +42,7 @@ public: @@ -42,6 +42,7 @@ public:
uint16_t failsafe_radio : 1; // 1 if radio failsafe
uint16_t failsafe_battery : 1; // 1 if battery failsafe
uint16_t failsafe_gps : 1; // 1 if gps failsafe
uint16_t arming_failed : 1; // 1 if copter failed to arm after user input
// additional flags
uint16_t external_leds : 1; // 1 if external LEDs are enabled (normally only used for copter)

7
libraries/AP_Notify/ToneAlarm_PX4.cpp

@ -64,6 +64,13 @@ void ToneAlarm_PX4::update() @@ -64,6 +64,13 @@ void ToneAlarm_PX4::update()
if (_tonealarm_fd == -1) {
return;
}
if(flags.arming_failed != AP_Notify::flags.arming_failed) {
flags.arming_failed = AP_Notify::flags.arming_failed;
if(flags.arming_failed) {
play_tune(TONE_ARMING_FAILURE_TUNE);
}
}
// check if arming status has changed
if (flags.armed != AP_Notify::flags.armed) {

1
libraries/AP_Notify/ToneAlarm_PX4.h

@ -41,6 +41,7 @@ private: @@ -41,6 +41,7 @@ private:
uint8_t failsafe_battery : 1; // 1 if battery failsafe
uint8_t gps_glitching : 1; // 1 if gps position is not good
uint8_t failsafe_gps : 1; // 1 if gps failsafe
uint8_t arming_failed : 1; // 0 = failing checks, 1 = passed
} flags;
};

Loading…
Cancel
Save