add flush functions for serial helpers

This commit is contained in:
2023-03-21 20:20:13 +01:00
parent 227524a21d
commit 341437df13
2 changed files with 7 additions and 0 deletions

View File

@ -161,3 +161,7 @@ void uart::setStopbits(struct termios& options, StopBits bits) {
options.c_cflag &= ~CSTOPB;
}
}
void uart::flushRxBuf(int fd) { tcflush(fd, TCIFLUSH); }
void uart::flushTxRxBuf(int fd) { tcflush(fd, TCIOFLUSH); }