From 50dafa3304bf26486d78bab65489f57ba8db8094 Mon Sep 17 00:00:00 2001 From: muramura Date: Thu, 31 Aug 2023 01:29:43 +0900 Subject: [PATCH] AP_Mount: Do not perform unnecessary processing --- libraries/AP_Mount/AP_Mount_Siyi.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Mount/AP_Mount_Siyi.cpp b/libraries/AP_Mount/AP_Mount_Siyi.cpp index c8e2ae78d2f20..da9e3a8449477 100644 --- a/libraries/AP_Mount/AP_Mount_Siyi.cpp +++ b/libraries/AP_Mount/AP_Mount_Siyi.cpp @@ -38,9 +38,11 @@ void AP_Mount_Siyi::init() const AP_SerialManager& serial_manager = AP::serialmanager(); _uart = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Gimbal, 0); - if (_uart != nullptr) { - _initialised = true; + if (_uart == nullptr) { + return; } + + _initialised = true; AP_Mount_Backend::init(); }