Copter: Only play GPS tone when armed

This commit is contained in:
Jonathan Challinger 2014-03-31 16:54:49 +09:00 committed by Randy Mackay
parent ea6fbae666
commit 045c6d8c3f
1 changed files with 1 additions and 1 deletions

View File

@ -1217,7 +1217,7 @@ static void update_GPS(void)
// run glitch protection and update AP_Notify if home has been initialised // run glitch protection and update AP_Notify if home has been initialised
if (ap.home_is_set) { if (ap.home_is_set) {
gps_glitch.check_position(); gps_glitch.check_position();
report_gps_glitch = (gps_glitch.glitching() && !ap.usb_connected); report_gps_glitch = (gps_glitch.glitching() && !ap.usb_connected && hal.util->safety_switch_state() != AP_HAL::Util::SAFETY_DISARMED);
if (AP_Notify::flags.gps_glitching != report_gps_glitch) { if (AP_Notify::flags.gps_glitching != report_gps_glitch) {
if (gps_glitch.glitching()) { if (gps_glitch.glitching()) {
Log_Write_Error(ERROR_SUBSYSTEM_GPS, ERROR_CODE_GPS_GLITCH); Log_Write_Error(ERROR_SUBSYSTEM_GPS, ERROR_CODE_GPS_GLITCH);