]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/serial.c
sr: always turn off ICRNL on serial ports
[libsigrok.git] / hardware / common / serial.c
index 51934ed859114dcaf16f673521eee4a0c07c8f73..ad88958a0d0feb5c6601651687acdb1dd593c4cd 100644 (file)
@@ -316,6 +316,10 @@ SR_PRIV int serial_set_params(int fd, int baudrate, int bits, int parity,
                return SR_ERR;
        }
 
+       /* Some default parameters */
+       term.c_iflag &= ~(ICRNL);
+       term.c_lflag &= ~(ICANON | ECHO);
+
        if (tcsetattr(fd, TCSADRAIN, &term) < 0)
                return SR_ERR;
 #endif