Compare commits
2 Commits
fb2e480705
...
improve-se
Author | SHA1 | Date | |
---|---|---|---|
3b0ee7ca31
|
|||
f307a86d9a
|
@@ -110,7 +110,7 @@ void serial::setBaudrate(struct termios& options, UartBaudRate baud) {
|
||||
#endif // ! __APPLE__
|
||||
default:
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << "UartComIF::configureBaudrate: Baudrate not supported" << std::endl;
|
||||
sif::warning << "serial::configureBaudrate: Baudrate not supported" << std::endl;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -155,12 +155,11 @@ int serial::readCountersAndErrors(int serialPort, serial_icounter_struct& icount
|
||||
}
|
||||
|
||||
void serial::setStopbits(struct termios& options, StopBits bits) {
|
||||
// Regular case: One stop bit.
|
||||
options.c_cflag &= ~CSTOPB;
|
||||
if (bits == StopBits::TWO_STOP_BITS) {
|
||||
// Use two stop bits
|
||||
options.c_cflag |= CSTOPB;
|
||||
} else {
|
||||
// Clear stop field, only one stop bit used in communication
|
||||
options.c_cflag &= ~CSTOPB;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,3 +168,4 @@ void serial::flushRxBuf(int fd) { tcflush(fd, TCIFLUSH); }
|
||||
void serial::flushTxBuf(int fd) { tcflush(fd, TCOFLUSH); }
|
||||
|
||||
void serial::flushTxRxBuf(int fd) { tcflush(fd, TCIOFLUSH); }
|
||||
|
||||
|
Reference in New Issue
Block a user