ardupilot/libraries/AP_Mount/AP_Mount_Backend_Serial.cpp
Peter Barker 99e314f49a AP_Mount: tidy header includes
our pattern is to include the config file and then use the relevant define, with nothing in between
2024-11-12 13:02:43 +11:00

28 lines
689 B
C++

#include "AP_Mount_config.h"
#if HAL_MOUNT_ENABLED
#include "AP_Mount_Backend_Serial.h"
#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