mirror of https://github.com/ArduPilot/ardupilot
AP_HAL_SITL: correct _unbuffered_writes usage
This commit is contained in:
parent
6d472376bb
commit
c30642a348
|
@ -160,7 +160,12 @@ size_t UARTDriver::write(const uint8_t *buffer, size_t size)
|
||||||
DataFlash_Class::instance()->Log_Write("SBUS", "TimeUS,ToD", "QQ",
|
DataFlash_Class::instance()->Log_Write("SBUS", "TimeUS,ToD", "QQ",
|
||||||
AP_HAL::micros64(), time);
|
AP_HAL::micros64(), time);
|
||||||
// write buffer straight to the file descriptor
|
// write buffer straight to the file descriptor
|
||||||
::write(_fd, buffer, size);
|
ssize_t nwritten = ::write(_fd, buffer, size);
|
||||||
|
if (nwritten == -1 && errno != EAGAIN && _uart_path) {
|
||||||
|
close(_fd);
|
||||||
|
_fd = -1;
|
||||||
|
_connected = false;
|
||||||
|
}
|
||||||
// these have no effect
|
// these have no effect
|
||||||
tcdrain(_fd);
|
tcdrain(_fd);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue