Skip to content

Commit ff3e61e

Browse files
committed
Empty the buffer before closing and then wait a little bit before returning.
1 parent 13a4d29 commit ff3e61e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arx_control/libatmega/libatmega.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ std::string atmega::strerror(uint8_t cmd) {
368368

369369
void atmega::close(atmega::handle fd) {
370370
if( fd >= 0 ) {
371+
::tcdrain(fd);
371372
::close(fd);
373+
std::this_thread::sleep_for(std::chrono::milliseconds(50));
372374
}
373375
}

0 commit comments

Comments
 (0)