mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-01 13:38:38 -04:00
Notify: add Lost Copter tone
This commit is contained in:
parent
a20a89181c
commit
043d24f03a
@ -72,6 +72,7 @@ public:
|
||||
|
||||
// additional flags
|
||||
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.
|
||||
|
@ -230,6 +230,17 @@ void ToneAlarm_PX4::update()
|
||||
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
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
uint8_t parachute_release : 1; // 1 if parachute is being released
|
||||
uint8_t pre_arm_check : 1; // 0 = failing checks, 1 = passed
|
||||
uint8_t failsafe_radio : 1; // 1 if radio failsafe
|
||||
uint8_t lost_copter : 1; // 1 if lost copter tone requested
|
||||
} flags;
|
||||
|
||||
int8_t _cont_tone_playing;
|
||||
|
Loading…
Reference in New Issue
Block a user