mirror of https://github.com/ArduPilot/ardupilot
Copter: add dataflash error for GPS glitch
This commit is contained in:
parent
6c5294f89e
commit
c596b27719
|
@ -1390,7 +1390,14 @@ static void update_GPS(void)
|
|||
|
||||
// run glitch protection and update AP_Notify
|
||||
gps_glitch.check_position();
|
||||
AP_Notify::flags.gps_glitching = gps_glitch.glitching();
|
||||
if (AP_Notify::flags.gps_glitching != gps_glitch.glitching()) {
|
||||
if (gps_glitch.glitching()) {
|
||||
Log_Write_Error(ERROR_SUBSYSTEM_GPS, ERROR_CODE_GPS_GLITCH);
|
||||
}else{
|
||||
Log_Write_Error(ERROR_SUBSYSTEM_GPS, ERROR_CODE_ERROR_RESOLVED);
|
||||
}
|
||||
AP_Notify::flags.gps_glitching = gps_glitch.glitching();
|
||||
}
|
||||
|
||||
// check if we can initialise home yet
|
||||
if (!ap.home_is_set) {
|
||||
|
|
|
@ -436,6 +436,7 @@ enum ap_message {
|
|||
#define ERROR_SUBSYSTEM_FAILSAFE_GCS 8
|
||||
#define ERROR_SUBSYSTEM_FAILSAFE_FENCE 9
|
||||
#define ERROR_SUBSYSTEM_FLGHT_MODE 10
|
||||
#define ERROR_SUBSYSTEM_GPS 11
|
||||
// general error codes
|
||||
#define ERROR_CODE_ERROR_RESOLVED 0
|
||||
#define ERROR_CODE_FAILED_TO_INITIALISE 1
|
||||
|
@ -446,6 +447,8 @@ enum ap_message {
|
|||
#define ERROR_CODE_FAILSAFE_OCCURRED 1
|
||||
// subsystem specific error codes -- compass
|
||||
#define ERROR_CODE_COMPASS_FAILED_TO_READ 2
|
||||
// subsystem specific error codes -- gps
|
||||
#define ERROR_CODE_GPS_GLITCH 2
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue