Browse Source

Buzzer: handle arming_failed as event

master
Randy Mackay 10 years ago
parent
commit
6cfd48d0c6
  1. 16
      libraries/AP_Notify/Buzzer.cpp
  2. 1
      libraries/AP_Notify/Buzzer.h

16
libraries/AP_Notify/Buzzer.cpp

@ -49,6 +49,12 @@ void Buzzer::update() @@ -49,6 +49,12 @@ void Buzzer::update()
return;
}
// check for arming failed event
if (AP_Notify::events.arming_failed) {
// arming failed buzz
play_pattern(SINGLE_BUZZ);
}
// reduce 50hz call down to 10hz
_counter++;
if (_counter < 5) {
@ -192,16 +198,6 @@ void Buzzer::update() @@ -192,16 +198,6 @@ void Buzzer::update()
return;
}
// check arming failed
if (_flags.arming_failed != AP_Notify::flags.arming_failed) {
_flags.arming_failed = AP_Notify::flags.arming_failed;
if (_flags.arming_failed) {
// arming failed buzz
play_pattern(SINGLE_BUZZ);
}
return;
}
// check gps glitch
if (_flags.gps_glitching != AP_Notify::flags.gps_glitching) {
_flags.gps_glitching = AP_Notify::flags.gps_glitching;

1
libraries/AP_Notify/Buzzer.h

@ -76,7 +76,6 @@ private: @@ -76,7 +76,6 @@ private:
uint8_t failsafe_battery : 1; // 1 if battery failsafe has triggered
uint8_t failsafe_gps : 1; // 1 if gps failsafe
uint8_t baro_glitching : 1; // 1 if baro alt is glitching
uint8_t arming_failed : 1; // 0 = failing checks, 1 = passed
uint8_t ekf_bad : 1; // 1 if ekf position has gone bad
} _flags;

Loading…
Cancel
Save