Notify: rename failsafe_action event

This commit is contained in:
Randy Mackay 2014-12-15 12:44:38 +09:00
parent 6a15d21704
commit 1c8ab375e2
2 changed files with 4 additions and 3 deletions

View File

@ -79,7 +79,7 @@ public:
uint8_t mission_complete : 1; // 1 when the mission has completed successfully
uint8_t waypoint_complete : 1; // 1 as vehicle completes a waypoint
uint8_t user_mode_change_failed : 1; // 1 when user initiated flight mode change fails
uint8_t failsafe_action_taken : 1; // unused
uint8_t failsafe_mode_change : 1; // 1 when failsafe has triggered a flight mode change
};
// the notify flags are static to allow direct class access

View File

@ -171,7 +171,8 @@ void ToneAlarm_PX4::update()
flags.user_mode_initialized = 1;
}
if(AP_Notify::events.failsafe_action_taken) {
// failsafe initiated mode change
if(AP_Notify::events.failsafe_mode_change) {
play_tone(AP_NOTIFY_PX4_TONE_LOUD_ATTENTION_NEEDED);
}
@ -187,7 +188,7 @@ void ToneAlarm_PX4::update()
if (flags.failsafe_radio != AP_Notify::flags.failsafe_radio) {
flags.failsafe_radio = AP_Notify::flags.failsafe_radio;
if (flags.failsafe_radio) {
// armed case handled by events.failsafe_action_taken
// armed case handled by events.failsafe_mode_change
if (!AP_Notify::flags.armed) {
play_tone(AP_NOTIFY_PX4_TONE_QUIET_NEG_FEEDBACK);
}