mirror of
https://github.com/dschmenk/apple2pi.git
synced 2025-02-17 05:30:59 +00:00
Drain superfluous single-byte sync requests.
This commit is contained in:
parent
6fc8a19dfe
commit
f9b513a838
11
src/a2pid.c
11
src/a2pid.c
@ -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);
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user