From 89a50b99bb5971d36a44ff089171e64c1d317d9d Mon Sep 17 00:00:00 2001 From: Mike Clement Date: Mon, 6 Apr 2015 14:47:11 -0700 Subject: [PATCH] SerialManager: use instance in find_baudrate --- libraries/AP_SerialManager/AP_SerialManager.cpp | 10 ++++++++-- libraries/AP_SerialManager/AP_SerialManager.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/AP_SerialManager/AP_SerialManager.cpp b/libraries/AP_SerialManager/AP_SerialManager.cpp index dff9319c50..42c92c80b0 100644 --- a/libraries/AP_SerialManager/AP_SerialManager.cpp +++ b/libraries/AP_SerialManager/AP_SerialManager.cpp @@ -187,13 +187,19 @@ AP_HAL::UARTDriver *AP_SerialManager::find_serial(enum SerialProtocol protocol, } // find_baudrate - searches available serial ports for the first instance that allows the given protocol +// instance should be zero if searching for the first instance, 1 for the second, etc // returns baudrate on success, 0 if a serial port cannot be found -uint32_t AP_SerialManager::find_baudrate(enum SerialProtocol protocol) const +uint32_t AP_SerialManager::find_baudrate(enum SerialProtocol protocol, uint8_t instance) const { + uint8_t found_instance = 0; + // search for matching protocol for(uint8_t i=0; i