HAL_Linux: disable input modifications on serial interface for rc receiver

Make sure to clear CBAUD before setting the baud and disable
input modifications.

Fix for #12162

This change removes input options that can modify the input data stream.
INLCR: map new line to carriage return
ICRNL: map carriage return to new line
IUCLC: map upper case to lower case
IGNCR: ignore carriage return
BRKINT: send SIGINT on serial break
This commit is contained in:
Daniel Magree 2019-08-28 14:58:59 -04:00 committed by Lucas De Marchi
parent 0844077df8
commit 209bb132fa

View File

@ -84,11 +84,12 @@ int RCInput_RCProtocol::open_115200(const char *path)
return -1;
}
tio.c_cflag &= ~(PARENB|CSTOPB|CSIZE);
tio.c_cflag |= CS8 | B115200;
tio.c_cflag &= ~(PARENB|CSTOPB|CSIZE|CBAUD);
tio.c_cflag |= CS8 | CREAD | CLOCAL | B115200;
tio.c_lflag &= ~(ICANON|ECHO|ECHOE|ISIG);
tio.c_iflag &= ~(IXON|IXOFF|IXANY);
tio.c_iflag &= ~(INLCR|ICRNL|IGNCR|IUCLC|BRKINT);
tio.c_oflag &= ~OPOST;
if (ioctl(fd, TCSETS2, &tio) != 0) {