GCS_MAVLink: fix flow control check

Thanks to Tridge for spotting is
This commit is contained in:
Randy Mackay 2015-05-15 15:35:45 +09:00
parent 227327c678
commit 559684b257

View File

@ -408,9 +408,14 @@ bool GCS_MAVLINK::have_flow_control(void)
if (mavlink_comm_port[chan] == NULL) {
return false;
} else {
// assume USB has flow control
}
if (chan == MAVLINK_COMM_0) {
// assume USB console has flow control
return hal.gpio->usb_connected() || mavlink_comm_port[chan]->get_flow_control() != AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE;
} else {
// all other channels
return mavlink_comm_port[chan]->get_flow_control() != AP_HAL::UARTDriver::FLOW_CONTROL_DISABLE;
}
}