AP_FrSky_Telem: Make init return false if we failed to init

This commit is contained in:
Michael du Breuil 2019-06-18 00:32:31 -07:00 committed by Andrew Tridgell
parent 278ac5e6ed
commit 59e62ca2fc
2 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ ObjectArray<mavlink_statustext_t> AP_Frsky_Telem::_statustext_queue(FRSKY_TELEM_
/*
* init - perform required initialisation
*/
void AP_Frsky_Telem::init()
bool AP_Frsky_Telem::init()
{
const AP_SerialManager &serial_manager = AP::serialmanager();
@ -65,7 +65,11 @@ void AP_Frsky_Telem::init()
hal.scheduler->register_io_process(FUNCTOR_BIND_MEMBER(&AP_Frsky_Telem::tick, void));
// we don't want flow control for either protocol
_port->set_flow_control(AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE);
return true;
}
return false;
}

View File

@ -119,7 +119,7 @@ public:
AP_Frsky_Telem &operator=(const AP_Frsky_Telem&) = delete;
// init - perform required initialisation
void init();
bool init();
// add statustext message to FrSky lib message queue
void queue_message(MAV_SEVERITY severity, const char *text);