Commit ec12dc7bcb248be501d8f84a88d6b73a1d341dec

Con Kolivas 2012-07-08T04:22:24

Merge pull request #257 from luke-jr/cfsetspeed Use standard cfsetispeed/cfsetospeed to set baud rate on *nix

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/fpgautils.c b/fpgautils.c
index 12e3847..0ebee7f 100644
--- a/fpgautils.c
+++ b/fpgautils.c
@@ -211,8 +211,8 @@ serial_open(const char*devpath, unsigned long baud, signed short timeout, bool p
 	case 0:
 		break;
 	case 115200:
-		my_termios.c_cflag &= ~CBAUD;
-		my_termios.c_cflag |= B115200;
+		cfsetispeed( &my_termios, B115200 );
+		cfsetospeed( &my_termios, B115200 );
 		break;
 	// TODO: try some higher speeds with the Icarus and BFL to see
 	// if they support them and if setting them makes any difference