]> sigrok.org Git - libsigrok.git/commitdiff
serial.c: fix parity != none
authorDaniel Ribeiro <redacted>
Mon, 10 Jan 2011 17:05:14 +0000 (15:05 -0200)
committerDaniel Ribeiro <redacted>
Mon, 10 Jan 2011 17:05:14 +0000 (15:05 -0200)
The flag write was wrong

hardware/common/serial.c

index cebca29e418dd833007c37572a747d2c84d85cbc..18b62d0c048ba1ddff72ee4596c15a23d118fad0 100644 (file)
@@ -228,16 +228,17 @@ int serial_set_params(int fd, int speed, int bits, int parity, int stopbits,
                return SIGROK_ERR;
        }
 
-       term.c_iflag &= ~(IGNPAR | PARODD | PARENB);
+       term.c_iflag &= ~IGNPAR;
+       term.c_cflag &= ~(PARODD | PARENB);
        switch (parity) {
        case 0:
                term.c_iflag |= IGNPAR;
                break;
        case 1:
-               term.c_iflag |= PARENB;
+               term.c_cflag |= PARENB;
                break;
        case 2:
-               term.c_iflag |= PARENB | PARODD;
+               term.c_cflag |= PARENB | PARODD;
                break;
        default:
                return SIGROK_ERR;