AP_RCTelemetry: use have_serial when detecting

avoid find_serial() as it changes port options
This commit is contained in:
Andrew Tridgell 2021-12-20 15:35:43 +11:00
parent 366ff24941
commit 178ae9e0c1
2 changed files with 3 additions and 3 deletions

View File

@ -55,8 +55,8 @@ AP_CRSF_Telem::~AP_CRSF_Telem(void)
bool AP_CRSF_Telem::init(void)
{
// sanity check that we are using a UART for RC input
if (!AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_RCIN, 0)
&& !AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_CRSF, 0)) {
if (!AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_RCIN, 0)
&& !AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_CRSF, 0)) {
return false;
}
return AP_RCTelemetry::init();

View File

@ -66,7 +66,7 @@ AP_Spektrum_Telem::~AP_Spektrum_Telem(void)
bool AP_Spektrum_Telem::init(void)
{
// sanity check that we are using a UART for RC input
if (!AP::serialmanager().find_serial(AP_SerialManager::SerialProtocol_RCIN, 0)) {
if (!AP::serialmanager().have_serial(AP_SerialManager::SerialProtocol_RCIN, 0)) {
return false;
}
return AP_RCTelemetry::init();