mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Cleanup
This commit is contained in:
parent
c08c023454
commit
078bb6213d
1 changed files with 9 additions and 9 deletions
18
src/tty.c
18
src/tty.c
|
|
@ -326,6 +326,15 @@ void tty_configure(void)
|
||||||
error_printf("Invalid parity");
|
error_printf("Invalid parity");
|
||||||
exit(EXIT_FAILURE);
|
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)
|
void tty_wait_for_device(void)
|
||||||
|
|
@ -456,15 +465,6 @@ int tty_connect(void)
|
||||||
first = false;
|
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 */
|
/* Activate new port settings */
|
||||||
status = tcsetattr(fd, TCSANOW, &tio);
|
status = tcsetattr(fd, TCSANOW, &tio);
|
||||||
if (status == -1)
|
if (status == -1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue