AP_SerialManager: added baudrates to get_passthru()

This commit is contained in:
Andrew Tridgell 2020-11-15 13:15:19 +11:00
parent 53cbd86cbe
commit d0db3eef58
2 changed files with 6 additions and 2 deletions

View File

@ -684,7 +684,8 @@ void AP_SerialManager::set_options(uint16_t i)
}
// get the passthru ports if enabled
bool AP_SerialManager::get_passthru(AP_HAL::UARTDriver *&port1, AP_HAL::UARTDriver *&port2, uint8_t &timeout_s) const
bool AP_SerialManager::get_passthru(AP_HAL::UARTDriver *&port1, AP_HAL::UARTDriver *&port2, uint8_t &timeout_s,
uint32_t &baud1, uint32_t &baud2) const
{
if (passthru_port2 < 0 ||
passthru_port2 >= SERIALMANAGER_NUM_PORTS ||
@ -694,6 +695,8 @@ bool AP_SerialManager::get_passthru(AP_HAL::UARTDriver *&port1, AP_HAL::UARTDriv
}
port1 = state[passthru_port1].uart;
port2 = state[passthru_port2].uart;
baud1 = map_baudrate(state[passthru_port1].baud);
baud2 = map_baudrate(state[passthru_port2].baud);
timeout_s = MAX(passthru_timeout, 0);
return true;
}

View File

@ -189,7 +189,8 @@ public:
void set_blocking_writes_all(bool blocking);
// get the passthru ports if enabled
bool get_passthru(AP_HAL::UARTDriver *&port1, AP_HAL::UARTDriver *&port2, uint8_t &timeout_s) const;
bool get_passthru(AP_HAL::UARTDriver *&port1, AP_HAL::UARTDriver *&port2, uint8_t &timeout_s,
uint32_t &baud1, uint32_t &baud2) const;
// disable passthru by settings SERIAL_PASS2 to -1
void disable_passthru(void);