Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Apr 2006 19:27:23 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 95891 for review
Message-ID:  <200604221927.k3MJRNFO073562@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95891

Change 95891 by marcel@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604221927.k3MJRNFO073562>