Skip to content

Commit

Permalink
AP_Notify: Perform common checks first
Browse files Browse the repository at this point in the history
  • Loading branch information
muramura committed Jun 26, 2024
1 parent c388943 commit fa5327f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions libraries/AP_Notify/RGBLed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fa5327f

Please sign in to comment.