Skip to content

Commit

Permalink
[arch/linux] fix uart driver
Browse files Browse the repository at this point in the history
make sure the output flags are properly reset for raw mode.
Specifically OPOST, clear some others as well to be safe...

might also fix paparazzi#743
  • Loading branch information
flixr committed Feb 16, 2015
1 parent ad4b72e commit 92d2b9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sw/airborne/arch/linux/serial_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ int serial_port_open_raw(struct SerialPort *me, const char *device, speed_t spe
/* local modes */
me->cur_termios.c_lflag &= ~(ISIG | ICANON | IEXTEN | ECHO | FLUSHO | PENDIN);
me->cur_termios.c_lflag |= NOFLSH;
/* output modes */
me->cur_termios.c_oflag &=~(OPOST|ONLCR|OCRNL|ONOCR|ONLRET);

if (cfsetispeed(&me->cur_termios, speed)) {
TRACE(TRACE_ERROR, "%s, set term speed failed: %s (%d)\n", device, strerror(errno), errno);
close(me->fd);
Expand Down

0 comments on commit 92d2b9b

Please sign in to comment.