kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Serial bug fix
Linux - added control flag to inhibit CR to NL conversion when opening the serial port for RDWRpull/2/head
rodzic
ccaaa1eb03
commit
933af6c242
|
@ -65,25 +65,36 @@ bool Cserial::OpenPort() {
|
|||
tcgetattr (fd, &oldtio);
|
||||
newtio = oldtio;
|
||||
|
||||
// 8 data bits
|
||||
newtio.c_cflag &= ~CSIZE;
|
||||
newtio.c_cflag |= CS8 | CLOCAL | CREAD;
|
||||
|
||||
newtio.c_cflag |= CS8;
|
||||
// enable receiver, set local mode
|
||||
newtio.c_cflag |= (CLOCAL | CREAD);
|
||||
// no parity
|
||||
newtio.c_cflag &= ~PARENB;
|
||||
|
||||
if (stopbits == 1)
|
||||
newtio.c_cflag &= ~CSTOPB; // 1 stop bit
|
||||
// 1 stop bit
|
||||
newtio.c_cflag &= ~CSTOPB;
|
||||
else
|
||||
newtio.c_cflag |= CSTOPB; // 2 stop bit
|
||||
// 2 stop bit
|
||||
newtio.c_cflag |= CSTOPB;
|
||||
|
||||
if (rtscts)
|
||||
// h/w handshake
|
||||
newtio.c_cflag |= CRTSCTS;
|
||||
else
|
||||
// no h/w handshake
|
||||
newtio.c_cflag &= ~CRTSCTS;
|
||||
|
||||
// raw input
|
||||
newtio.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
|
||||
// raw output
|
||||
newtio.c_oflag &= ~OPOST;
|
||||
|
||||
// software flow control disabled
|
||||
newtio.c_iflag &= ~IXON;
|
||||
// do not translate CR to NL
|
||||
newtio.c_iflag &= ~ICRNL;
|
||||
|
||||
switch(baud) {
|
||||
case 300:
|
||||
|
|
Ładowanie…
Reference in New Issue