More thorough override on "-s 0" to stop termios interfering
This commit is contained in:
parent
051b086c0f
commit
c857c88fd6
|
@ -63,13 +63,15 @@ int serial_init(char const *serial_port, char const *speed) {
|
|||
fprintf(stderr, "Failed to set port speed.\n");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "Not setting baud rate.\n");
|
||||
|
||||
t_options.c_lflag &= ~(ICANON | ECHO | ECHOE);
|
||||
t_options.c_oflag &= ~OPOST;
|
||||
if (tcsetattr(serial_fd, TCSANOW, &t_options) < 0){
|
||||
if (tcsetattr(serial_fd, TCSANOW, &t_options) < 0) {
|
||||
fprintf(stderr, "Failed to set termios attrs.\n");
|
||||
}
|
||||
}
|
||||
serial_flush(serial_fd);
|
||||
return serial_fd;
|
||||
}
|
Loading…
Reference in New Issue