AP_Mount: Do not perform unnecessary processing

This commit is contained in:
muramura 2023-08-31 01:14:45 +09:00 committed by Peter Barker
parent 2c267f462d
commit a9d0bf856e
2 changed files with 7 additions and 4 deletions

View File

@ -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();
}

View File

@ -34,10 +34,11 @@ void AP_Mount_Viewpro::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();
}