2024-11-08 19:29:06 -04:00
|
|
|
#include "AP_Mount_config.h"
|
2024-05-21 22:12:22 -03:00
|
|
|
|
|
|
|
#if HAL_MOUNT_ENABLED
|
2024-11-08 19:29:06 -04:00
|
|
|
|
|
|
|
#include "AP_Mount_Backend_Serial.h"
|
|
|
|
|
2024-05-21 22:12:22 -03:00
|
|
|
#include <AP_SerialManager/AP_SerialManager.h>
|
|
|
|
|
|
|
|
// Default init function for every mount
|
|
|
|
void AP_Mount_Backend_Serial::init()
|
|
|
|
{
|
|
|
|
const AP_SerialManager& serial_manager = AP::serialmanager();
|
|
|
|
|
|
|
|
// search for serial port. hild classes should check that uart is not nullptr
|
|
|
|
_uart = serial_manager.find_serial(AP_SerialManager::SerialProtocol_Gimbal, _serial_instance);
|
|
|
|
if (_uart == nullptr) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// initialised successfully if uart is found
|
|
|
|
_initialised = true;
|
|
|
|
|
|
|
|
// call the parent class init
|
|
|
|
AP_Mount_Backend::init();
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // HAL_MOUNT_ENABLED
|