Browse Source

Notify: add Lost Copter tone

mission-4.1.18
Jaime Machuca 10 years ago committed by Randy Mackay
parent
commit
043d24f03a
  1. 1
      libraries/AP_Notify/AP_Notify.h
  2. 11
      libraries/AP_Notify/ToneAlarm_PX4.cpp
  3. 1
      libraries/AP_Notify/ToneAlarm_PX4.h

1
libraries/AP_Notify/AP_Notify.h

@ -72,6 +72,7 @@ public:
// additional flags // additional flags
uint32_t external_leds : 1; // 1 if external LEDs are enabled (normally only used for copter) uint32_t external_leds : 1; // 1 if external LEDs are enabled (normally only used for copter)
uint32_t lost_copter : 1; // 1 when lost copter tone is requested (normally only used for copter)
}; };
/// notify_events_type - bitmask of active events. /// notify_events_type - bitmask of active events.

11
libraries/AP_Notify/ToneAlarm_PX4.cpp

@ -230,6 +230,17 @@ void ToneAlarm_PX4::update()
play_tone(AP_NOTIFY_PX4_TONE_LOUD_ATTENTION_NEEDED); play_tone(AP_NOTIFY_PX4_TONE_LOUD_ATTENTION_NEEDED);
} }
} }
if (flags.lost_copter != AP_Notify::flags.lost_copter) {
flags.lost_copter = AP_Notify::flags.lost_copter;
if(flags.lost_copter) {
play_tone(AP_NOTIFY_PX4_TONE_LOUD_LOST_COPTER_CTS);
}else{
stop_cont_tone();
}
}
} }
#endif // CONFIG_HAL_BOARD == HAL_BOARD_PX4 #endif // CONFIG_HAL_BOARD == HAL_BOARD_PX4

1
libraries/AP_Notify/ToneAlarm_PX4.h

@ -54,6 +54,7 @@ private:
uint8_t parachute_release : 1; // 1 if parachute is being released uint8_t parachute_release : 1; // 1 if parachute is being released
uint8_t pre_arm_check : 1; // 0 = failing checks, 1 = passed uint8_t pre_arm_check : 1; // 0 = failing checks, 1 = passed
uint8_t failsafe_radio : 1; // 1 if radio failsafe uint8_t failsafe_radio : 1; // 1 if radio failsafe
uint8_t lost_copter : 1; // 1 if lost copter tone requested
} flags; } flags;
int8_t _cont_tone_playing; int8_t _cont_tone_playing;

Loading…
Cancel
Save