From 84ff78f5c6ace6d2e3b332dae166e84b196f4dcf Mon Sep 17 00:00:00 2001 From: muramura Date: Wed, 26 Jun 2024 21:27:17 +0900 Subject: [PATCH] AP_Notify: Perform common checks first --- libraries/AP_Notify/RGBLed.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libraries/AP_Notify/RGBLed.cpp b/libraries/AP_Notify/RGBLed.cpp index 944fb1d0e8..caa549fd94 100644 --- a/libraries/AP_Notify/RGBLed.cpp +++ b/libraries/AP_Notify/RGBLed.cpp @@ -165,16 +165,13 @@ uint32_t RGBLed::get_colour_sequence(void) const if (!AP_Notify::flags.pre_arm_check) { return sequence_prearm_failing; } - if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D_DGPS && - AP_Notify::flags.pre_arm_gps_check && - good_ahrs_location) { - return sequence_disarmed_good_dgps_and_location; - } - - if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D && - AP_Notify::flags.pre_arm_gps_check && - good_ahrs_location) { - return sequence_disarmed_good_gps_and_location; + if (AP_Notify::flags.pre_arm_gps_check && good_ahrs_location) { + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D_DGPS) { + return sequence_disarmed_good_dgps_and_location; + } + if (AP_Notify::flags.gps_status >= AP_GPS::GPS_OK_FIX_3D) { + return sequence_disarmed_good_gps_and_location; + } } #endif