mirror of
https://github.com/dschmenk/apple2pi.git
synced 2025-02-21 17:29:00 +00:00
Allow waiting for attachment of USB device to be interrrupted.
This commit is contained in:
parent
7be6aed0b9
commit
ea1f91044d
@ -653,13 +653,21 @@ openserial:
|
|||||||
* Open serial port.
|
* Open serial port.
|
||||||
*/
|
*/
|
||||||
while (!pathmatch(&devtty, ttypattern))
|
while (!pathmatch(&devtty, ttypattern))
|
||||||
|
{
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
if (state == STOP)
|
||||||
|
die("interrupted");
|
||||||
|
}
|
||||||
prlog("a2pid: Open serial port\n");
|
prlog("a2pid: Open serial port\n");
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("a2pid: open %s\n", devtty);
|
printf("a2pid: open %s\n", devtty);
|
||||||
#endif
|
#endif
|
||||||
while ((a2fd = open(devtty, O_RDWR | O_NOCTTY)) < 0)
|
while ((a2fd = open(devtty, O_RDWR | O_NOCTTY)) < 0)
|
||||||
|
{
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
if (state == STOP)
|
||||||
|
die("interrupted");
|
||||||
|
}
|
||||||
tcflush(a2fd, TCIFLUSH);
|
tcflush(a2fd, TCIFLUSH);
|
||||||
tcgetattr(a2fd, &oldtio); /* save current port settings */
|
tcgetattr(a2fd, &oldtio); /* save current port settings */
|
||||||
bzero(&newtio, sizeof(newtio));
|
bzero(&newtio, sizeof(newtio));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user