Added missing break statements in the serial_flush() functions.
This commit is contained in:
parent
76e5f12094
commit
c5fc289cb2
@ -511,10 +511,13 @@ serial_flush (serial *device, int queue)
|
|||||||
switch (queue) {
|
switch (queue) {
|
||||||
case SERIAL_QUEUE_INPUT:
|
case SERIAL_QUEUE_INPUT:
|
||||||
flags = TCIFLUSH;
|
flags = TCIFLUSH;
|
||||||
|
break;
|
||||||
case SERIAL_QUEUE_OUTPUT:
|
case SERIAL_QUEUE_OUTPUT:
|
||||||
flags = TCOFLUSH;
|
flags = TCOFLUSH;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
flags = TCIOFLUSH;
|
flags = TCIOFLUSH;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tcflush (device->fd, flags) != 0) {
|
if (tcflush (device->fd, flags) != 0) {
|
||||||
|
|||||||
@ -355,10 +355,13 @@ serial_flush (serial* device, int queue)
|
|||||||
switch (queue) {
|
switch (queue) {
|
||||||
case SERIAL_QUEUE_INPUT:
|
case SERIAL_QUEUE_INPUT:
|
||||||
flags = PURGE_RXABORT | PURGE_RXCLEAR;
|
flags = PURGE_RXABORT | PURGE_RXCLEAR;
|
||||||
|
break;
|
||||||
case SERIAL_QUEUE_OUTPUT:
|
case SERIAL_QUEUE_OUTPUT:
|
||||||
flags = PURGE_TXABORT | PURGE_TXCLEAR;
|
flags = PURGE_TXABORT | PURGE_TXCLEAR;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
flags = PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR;
|
flags = PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PurgeComm (device->hFile, flags)) {
|
if (!PurgeComm (device->hFile, flags)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user