1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 10:04:33 +00:00

Merge pull request #236 from kanoi/master

fpgautils.c - set BAUD rate according to termio spec
This commit is contained in:
Con Kolivas 2012-06-25 23:06:57 -07:00
commit 405eeb6337

View File

@ -186,8 +186,14 @@ serial_open(const char*devpath, unsigned long baud, signed short timeout, bool p
tcgetattr(fdDev, &my_termios); tcgetattr(fdDev, &my_termios);
switch (baud) { switch (baud) {
case 0: break; case 0:
case 115200: my_termios.c_cflag = B115200; break; 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: default:
applog(LOG_WARNING, "Unrecognized baud rate: %lu", baud); applog(LOG_WARNING, "Unrecognized baud rate: %lu", baud);
} }