Switch to simpler terminal settings.

This commit is contained in:
David Betz 2015-02-08 11:52:12 -05:00
parent 8f11a1678a
commit 8468c9dc49
1 changed files with 2 additions and 15 deletions

View File

@ -257,23 +257,10 @@ int serial_baud(unsigned long baud)
sparm = old_sparm;
/* set raw input */
#ifdef MACOSX
cfmakeraw(&sparm);
sparm.c_cc[VTIME] = 0;
sparm.c_cc[VMIN] = 1;
chk("cfsetspeed", cfsetspeed(&sparm, tbaud));
#else
memset(&sparm, 0, sizeof(sparm));
sparm.c_cflag = CS8 | CLOCAL | CREAD;
sparm.c_lflag = 0; // &= ~(ICANON | ECHO | ECHOE | ISIG);
sparm.c_oflag = 0; // &= ~OPOST;
sparm.c_iflag = IGNPAR | IGNBRK;
cfmakeraw(&sparm);
sparm.c_cc[VTIME] = 0;
sparm.c_cc[VMIN] = 1;
chk("cfsetispeed", cfsetispeed(&sparm, tbaud));
chk("cfsetospeed", cfsetospeed(&sparm, tbaud));
#endif
chk("cfsetspeed", cfsetspeed(&sparm, tbaud));
/* set the options */
chk("tcflush", tcflush(hSerial, TCIFLUSH));