From c540cd9126e83703abc59c4e096e84d265e568a1 Mon Sep 17 00:00:00 2001 From: Kano Date: Tue, 26 Jun 2012 02:34:44 +1000 Subject: [PATCH] fpgautils.c - set BAUD rate according to termio spec --- fpgautils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fpgautils.c b/fpgautils.c index 59eb7bcd..6211bbca 100644 --- a/fpgautils.c +++ b/fpgautils.c @@ -186,8 +186,14 @@ serial_open(const char*devpath, unsigned long baud, signed short timeout, bool p tcgetattr(fdDev, &my_termios); switch (baud) { - case 0: break; - case 115200: my_termios.c_cflag = B115200; break; + case 0: + break; + case 115200: + my_termios.c_cflag &= ~CBAUD; + my_termios.c_cflag |= 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 default: applog(LOG_WARNING, "Unrecognized baud rate: %lu", baud); }