Browse Source

gps: explicitly disable flow control

If the GPS driver was used on another port (e.g. TELEM2), it would get
stuck in a `write` call and not return anymore. Disabling flow control
fixes that.

CPU usage is unchanged.
sbg
Beat Küng 7 years ago committed by Lorenz Meier
parent
commit
03b8cd78b3
  1. 4
      src/drivers/gps/gps.cpp

4
src/drivers/gps/gps.cpp

@ -530,8 +530,8 @@ int GPS::setBaudrate(unsigned baud)
// //
uart_config.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG); uart_config.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);
/* no parity, one stop bit */ /* no parity, one stop bit, disable flow control */
uart_config.c_cflag &= ~(CSTOPB | PARENB); uart_config.c_cflag &= ~(CSTOPB | PARENB | CRTSCTS);
/* set baud rate */ /* set baud rate */
if ((termios_state = cfsetispeed(&uart_config, speed)) < 0) { if ((termios_state = cfsetispeed(&uart_config, speed)) < 0) {

Loading…
Cancel
Save