This commit is contained in:
Martin Lund 2017-11-02 16:22:24 +01:00
parent c08c023454
commit 078bb6213d

View file

@ -326,6 +326,15 @@ void tty_configure(void)
error_printf("Invalid parity");
exit(EXIT_FAILURE);
}
/* Control, input, output, local modes for tty device */
tio.c_cflag |= CLOCAL | CREAD;
tio.c_oflag = 0;
tio.c_lflag = 0;
/* Control characters */
tio.c_cc[VTIME] = 0; // Inter-character timer unused
tio.c_cc[VMIN] = 1; // Blocking read until 1 character received
}
void tty_wait_for_device(void)
@ -456,15 +465,6 @@ int tty_connect(void)
first = false;
}
/* Control, input, output, local modes for tty device */
tio.c_cflag |= CLOCAL | CREAD;
tio.c_oflag = 0;
tio.c_lflag = 0;
/* Control characters */
tio.c_cc[VTIME] = 0; /* Inter-character timer unused */
tio.c_cc[VMIN] = 1; /* Blocking read until 1 character received */
/* Activate new port settings */
status = tcsetattr(fd, TCSANOW, &tio);
if (status == -1)