You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
683 B

  1. From 0fd3078b4863002e5d384d7e453d668841414abe Mon Sep 17 00:00:00 2001
  2. From: Kay Sievers <kay@vrfy.org>
  3. Date: Wed, 13 Jan 2021 01:34:08 +0100
  4. Subject: [PATCH] PosixSerialPort: Call tcdrain() to write serial data
  5. GithubPR: 150
  6. ---
  7. src/PosixSerialPort.cpp | 5 +----
  8. 1 file changed, 1 insertion(+), 4 deletions(-)
  9. --- a/src/PosixSerialPort.cpp
  10. +++ b/src/PosixSerialPort.cpp
  11. @@ -290,10 +290,7 @@ PosixSerialPort::put(int c)
  12. void
  13. PosixSerialPort::flush()
  14. {
  15. - // There isn't a reliable way to flush on a file descriptor
  16. - // so we just wait it out. One millisecond is the USB poll
  17. - // interval so that should cover it.
  18. - usleep(1000);
  19. + tcdrain(_devfd);
  20. }
  21. bool