mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_HAL_Linux: do not create unnecessary consoles in UARTDriver
This commit is contained in:
parent
7b3a5e3158
commit
a1f151a79b
@ -61,9 +61,10 @@ void UARTDriver::begin(uint32_t b)
|
||||
|
||||
void UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS)
|
||||
{
|
||||
if (!_initialised) {
|
||||
if (device_path == NULL && _console) {
|
||||
_device = new ConsoleDevice();
|
||||
} else if (!_initialised) {
|
||||
} else {
|
||||
if (device_path == NULL) {
|
||||
return;
|
||||
}
|
||||
@ -76,6 +77,7 @@ void UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS)
|
||||
_device = new ConsoleDevice();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_connected) {
|
||||
_connected = _device->open();
|
||||
|
Loading…
Reference in New Issue
Block a user