mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-02 19:53:57 -04:00
AP_HAL_SITL: Clear UART buffers when opening a port
This commit is contained in:
parent
512939a839
commit
8680f1ab52
@ -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…
Reference in New Issue
Block a user