Browse Source

AP_Frsky_Telem: use serialmanager singleton

mission-4.1.18
Peter Barker 6 years ago committed by Francisco Ferreira
parent
commit
db4b1aa7aa
  1. 5
      libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp
  2. 3
      libraries/AP_Frsky_Telem/AP_Frsky_Telem.h

5
libraries/AP_Frsky_Telem/AP_Frsky_Telem.cpp

@ -41,10 +41,11 @@ AP_Frsky_Telem::AP_Frsky_Telem(AP_AHRS &ahrs, const AP_BattMonitor &battery, con @@ -41,10 +41,11 @@ AP_Frsky_Telem::AP_Frsky_Telem(AP_AHRS &ahrs, const AP_BattMonitor &battery, con
/*
* init - perform required initialisation
*/
void AP_Frsky_Telem::init(const AP_SerialManager &serial_manager,
const uint8_t mav_type,
void AP_Frsky_Telem::init(const uint8_t mav_type,
const uint32_t *ap_valuep)
{
const AP_SerialManager &serial_manager = AP::serialmanager();
// check for protocol configured for a serial port - only the first serial port with one of these protocols will then run (cannot have FrSky on multiple serial ports)
if ((_port = serial_manager.find_serial(AP_SerialManager::SerialProtocol_FrSky_D, 0))) {
_protocol = AP_SerialManager::SerialProtocol_FrSky_D; // FrSky D protocol (D-receivers)

3
libraries/AP_Frsky_Telem/AP_Frsky_Telem.h

@ -123,8 +123,7 @@ public: @@ -123,8 +123,7 @@ public:
AP_Frsky_Telem &operator=(const AP_Frsky_Telem&) = delete;
// init - perform required initialisation
void init(const AP_SerialManager &serial_manager,
const uint8_t mav_type,
void init(const uint8_t mav_type,
const uint32_t *ap_valuep = nullptr);
// add statustext message to FrSky lib message queue

Loading…
Cancel
Save