From 3923dcb63eaef5413eb188a7408761cad18488c8 Mon Sep 17 00:00:00 2001 From: yaapu Date: Fri, 7 Jul 2023 13:30:54 -0500 Subject: [PATCH] AP_Arming: added OSD_TYPE2 param to enable dual OSDs backend support Co-authored-by:HWurzburg(hurzburg@yahoo.com) up to 2 OSD instances can run at the same time sharing a single OSD thread --- libraries/AP_Arming/AP_Arming.cpp | 12 ++++++------ libraries/AP_Arming/AP_Arming.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 9059488b7b..3b18debbd0 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -1253,20 +1253,20 @@ bool AP_Arming::camera_checks(bool display_failure) bool AP_Arming::osd_checks(bool display_failure) const { -#if OSD_PARAM_ENABLED && OSD_ENABLED - if (check_enabled(ARMING_CHECK_CAMERA)) { +#if OSD_ENABLED + if (check_enabled(ARMING_CHECK_OSD)) { + // if no OSD then pass const AP_OSD *osd = AP::osd(); if (osd == nullptr) { return true; } - - // check camera is ready + // do osd checks for configuration char fail_msg[MAVLINK_MSG_STATUSTEXT_FIELD_TEXT_LEN+1]; if (!osd->pre_arm_check(fail_msg, ARRAY_SIZE(fail_msg))) { - check_failed(ARMING_CHECK_CAMERA, display_failure, "%s", fail_msg); + check_failed(ARMING_CHECK_OSD, display_failure, "%s", fail_msg); return false; } - } + } #endif return true; } diff --git a/libraries/AP_Arming/AP_Arming.h b/libraries/AP_Arming/AP_Arming.h index 24baf3683a..0423f94383 100644 --- a/libraries/AP_Arming/AP_Arming.h +++ b/libraries/AP_Arming/AP_Arming.h @@ -39,6 +39,7 @@ public: ARMING_CHECK_AUX_AUTH = (1U << 17), ARMING_CHECK_VISION = (1U << 18), ARMING_CHECK_FFT = (1U << 19), + ARMING_CHECK_OSD = (1U << 20), }; enum class Method {