From 4df0a1975e35edab2db8067c0af2bdc41a5990d6 Mon Sep 17 00:00:00 2001 From: shipp02 <51503822+shipp02@users.noreply.github.com> Date: Mon, 22 Apr 2024 18:08:57 -0700 Subject: [PATCH] Copter: Give better error in opendroneid build when DID_ENABLE=0. --- libraries/AP_OpenDroneID/AP_OpenDroneID.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp b/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp index 0e643d8d863ad9..25dd25ca626355 100644 --- a/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp +++ b/libraries/AP_OpenDroneID/AP_OpenDroneID.cpp @@ -161,6 +161,10 @@ void AP_OpenDroneID::get_persistent_params(ExpandingString &str) const bool AP_OpenDroneID::pre_arm_check(char* failmsg, uint8_t failmsg_len) { WITH_SEMAPHORE(_sem); + if(_enable == 0) { + strncpy(failmsg, "DID_ENABLE must be 1", failmsg_len); + return false; + } if (!option_enabled(Options::EnforceArming)) { return true;