Notify: add Lost Copter tone

This commit is contained in:
Jaime Machuca 2015-04-11 15:20:02 -05:00 committed by Randy Mackay
parent a20a89181c
commit 043d24f03a
3 changed files with 13 additions and 0 deletions

View File

@ -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.

View File

@ -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

View File

@ -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;