Merge remote-tracking branch 'ressi/input-fix'

This commit is contained in:
IOhannes m zmölnig 2022-03-21 09:30:22 +01:00
commit 4fcbc3dcb1

View file

@ -948,13 +948,19 @@ static int open_serial(unsigned int com_num, t_comport *x)
/* enable input and ignore modem controls */ /* enable input and ignore modem controls */
new->c_cflag |= (CREAD | CLOCAL); new->c_cflag |= (CREAD | CLOCAL);
#if 1
/* always nocanonical, this means raw i/o no terminal */ /* always nocanonical, this means raw i/o no terminal */
new->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); new->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
/* don't process input */
new->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
/* no post processing */ /* no post processing */
new->c_oflag &= ~OPOST; new->c_oflag &= ~OPOST;
#else
/* set to raw mode */
cfmakeraw(new);
#endif
/* setup to return after 0 seconds /* setup to return after 0 seconds
..if no characters are received ..if no characters are received
TIME units are assumed to be 0.1 secs */ TIME units are assumed to be 0.1 secs */