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_Arming: allow arming checks ALL to pass when logging is disabled #10265

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions libraries/AP_Arming/AP_Arming.cpp
Expand Up @@ -200,6 +200,10 @@ bool AP_Arming::logging_checks(bool report)
{
if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING)) {
if (!AP::logger().logging_present()) {
// Logging is disabled, so nothing to check.
return true;
}
if (AP::logger().logging_failed()) {
check_failed(ARMING_CHECK_LOGGING, report, "Logging failed");
return false;
Expand Down Expand Up @@ -722,11 +726,18 @@ bool AP_Arming::arm_checks(ArmingMethod method)

// note that this will prepare AP_Logger to start logging
// so should be the last check to be done before arming
if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING)) {
AP_Logger *df = AP_Logger::instance();

// Note also that we need to PrepForArming() regardless of whether
// the arming check flag is set - disabling the arming check
// should not stop logging from working.

AP_Logger *df = AP_Logger::instance();
if (df->logging_present()) {
// If we're configured to log, prep it
df->PrepForArming();
if (!df->logging_started()) {
if (!df->logging_started() &&
((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_LOGGING))) {
check_failed(ARMING_CHECK_LOGGING, true, "Logging not started");
return false;
}
Expand Down