Browse Source

AP_HAL_SITL: Clear UART buffers when opening a port

mission-4.1.18
Michael du Breuil 7 years ago committed by Francisco Ferreira
parent
commit
8680f1ab52
  1. 5
      libraries/AP_HAL_SITL/UARTDriver.cpp

5
libraries/AP_HAL_SITL/UARTDriver.cpp

@ -105,6 +105,11 @@ void UARTDriver::begin(uint32_t baud, uint16_t rxSpace, uint16_t txSpace) @@ -105,6 +105,11 @@ void UARTDriver::begin(uint32_t baud, uint16_t rxSpace, uint16_t txSpace)
free(s);
}
if (hal.console != this) { // don't clear USB buffers (allows early startup messages to escape)
_readbuffer.clear();
_writebuffer.clear();
}
_set_nonblocking(_fd);
}

Loading…
Cancel
Save