Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Notify: Perform common checks first #27394

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading