Drain superfluous single-byte sync requests.

This commit is contained in:
Oliver Schmidt 2022-08-24 23:41:40 +02:00
parent 6fc8a19dfe
commit f9b513a838

View File

@ -694,6 +694,17 @@ openserial:
state = RESET;
}
}
/* drain superfluous sync requests from potential fifo */
while (read(a2fd, iopkt, 1) == 1)
{
/* there's already some other request */
if (iopkt[0] != 0x80)
{
/* 'simulate terminal input' for a push back */
ioctl(a2fd, TIOCSTI, iopkt);
break;
}
}
newtio.c_cc[VMIN] = 3; /* blocking read until 3 chars received */
tcsetattr(a2fd, TCSANOW, &newtio);
/*