Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mart Lubbers
CleanSerial
Commits
73332929
Unverified
Commit
73332929
authored
Sep 03, 2018
by
Matheus Andrade
Browse files
Fixed input buffer VMIN value
Also, removed unnecessary debug print
parent
cb126d17
Changes
1
Show whitespace changes
Inline
Side-by-side
POSIX/tty.c
View file @
73332929
...
...
@@ -149,12 +149,11 @@ void ttyopen(CleanString fn, int baudrate, int bytesize, int parity,
//Set
tio
.
c_oflag
=
0
;
tio
.
c_lflag
&=
~
(
ECHO
|
ECHONL
|
ICANON
|
IEXTEN
|
ISIG
);
// tio.c_lflag |= ICANON;
#ifdef __APPLE__
tio
.
c_cflag
|=
CLOCAL
;
#endif
tio
.
c_cc
[
VMIN
]
=
5
;
tio
.
c_cc
[
VMIN
]
=
1
;
tio
.
c_cc
[
VTIME
]
=
0
;
tcsetattr
(
*
fd
,
TCSANOW
,
&
tio
);
...
...
@@ -215,7 +214,7 @@ int ttywrite(CleanString s, int fd)
int
i
;
for
(
i
=
0
;
i
<
CleanStringLength
(
s
);
i
++
){
unsigned
char
c
=
((
unsigned
char
*
)
CleanStringCharacters
(
s
))[
i
];
printf
(
"%02x(%u) "
,
c
,
c
);
//
printf("%02x(%u) ", c, c);
}
write
(
fd
,
(
void
*
)
CleanStringCharacters
(
s
),
CleanStringLength
(
s
));
tcdrain
(
fd
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment