From 078bb6213dd2edee50ebce14792de5ac7f0d3b52 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Thu, 2 Nov 2017 16:22:24 +0100 Subject: [PATCH] Cleanup --- src/tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tty.c b/src/tty.c index 88de59b..a8b08b8 100644 --- a/src/tty.c +++ b/src/tty.c @@ -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)