Browse Source

Notify: rename failsafe_action event

mission-4.1.18
Randy Mackay 10 years ago
parent
commit
1c8ab375e2
  1. 2
      libraries/AP_Notify/AP_Notify.h
  2. 5
      libraries/AP_Notify/ToneAlarm_PX4.cpp

2
libraries/AP_Notify/AP_Notify.h

@ -79,7 +79,7 @@ public:
uint8_t mission_complete : 1; // 1 when the mission has completed successfully 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 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 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 // the notify flags are static to allow direct class access

5
libraries/AP_Notify/ToneAlarm_PX4.cpp

@ -171,7 +171,8 @@ void ToneAlarm_PX4::update()
flags.user_mode_initialized = 1; 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); 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) { if (flags.failsafe_radio != AP_Notify::flags.failsafe_radio) {
flags.failsafe_radio = AP_Notify::flags.failsafe_radio; flags.failsafe_radio = AP_Notify::flags.failsafe_radio;
if (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) { if (!AP_Notify::flags.armed) {
play_tone(AP_NOTIFY_PX4_TONE_QUIET_NEG_FEEDBACK); play_tone(AP_NOTIFY_PX4_TONE_QUIET_NEG_FEEDBACK);
} }

Loading…
Cancel
Save