AP_HAL_SITL: Clear UART buffers when opening a port

This commit is contained in:
Michael du Breuil 2018-06-20 02:01:08 -07:00 committed by Francisco Ferreira
parent 512939a839
commit 8680f1ab52

View File

@ -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);
}