PERFORCE change 95891 for review

Marcel Moolenaar marcel at FreeBSD.org
Sat Apr 22 19:27:24 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=95891

Change 95891 by marcel at marcel_nfs on 2006/04/22 19:26:24

	o  Wait for the DSR to be asserted before doing anything else.
	o  Bump the default speed to 115200. I'm not testing the Z8530
	   as much nowadays.

Affected files ...

.. //depot/projects/uart/dev/uart/uarttest.c#5 edit

Differences ...

==== //depot/projects/uart/dev/uart/uarttest.c#5 (text+ko) ====

@@ -85,6 +85,10 @@
 	ssize_t count, wc;
 	int sig;
 
+	ioctl(fd, TIOCMGET, &sig);
+	while (!(sig & TIOCM_DSR))
+		ioctl(fd, TIOCMGET, &sig);
+
 	for (count = 0; count < sizeof(buffer); count++)
 		buffer[count] = count;
 
@@ -102,10 +106,9 @@
 	printf("dte: %u bytes transmitted\n", count);
 
 	ioctl(fd, TIOCDRAIN);
-	do {
-		sleep(1);
+	ioctl(fd, TIOCMGET, &sig);
+	while (sig & TIOCM_DSR)
 		ioctl(fd, TIOCMGET, &sig);
-	} while (sig & TIOCM_DSR);
 }
 
 static void
@@ -114,6 +117,10 @@
 	ssize_t count, rc;
 	int delta, diff, sig;
 
+	ioctl(fd, TIOCMGET, &sig);
+	while (sig & TIOCM_DSR)
+		ioctl(fd, TIOCMGET, &sig);
+
 	count = 0;
 	delta = 0;
 	errno = 0;
@@ -191,7 +198,7 @@
 	tcgetattr(fd, &t0);
 	t1 = t0;
 	cfmakeraw(&t1);
-	cfsetspeed(&t1, B19200);
+	cfsetspeed(&t1, B115200);
 	switch (how) {
 	case AS_DCE:
 		t1.c_cflag |= CRTS_IFLOW;


More information about the p4-projects mailing list