Merge pull request #118 from mwm/master
Fix file open to actually turn on inbound parity checking.
This commit is contained in:
commit
9695c368e0
|
@ -128,8 +128,8 @@ static port_err_t serial_setup(serial_t *h, const serial_baud_t baud,
|
||||||
|
|
||||||
switch (parity) {
|
switch (parity) {
|
||||||
case SERIAL_PARITY_NONE: port_parity = 0; break;
|
case SERIAL_PARITY_NONE: port_parity = 0; break;
|
||||||
case SERIAL_PARITY_EVEN: port_parity = INPCK | PARENB; break;
|
case SERIAL_PARITY_EVEN: port_parity = PARENB; break;
|
||||||
case SERIAL_PARITY_ODD: port_parity = INPCK | PARENB | PARODD; break;
|
case SERIAL_PARITY_ODD: port_parity = PARENB | PARODD; break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return PORT_ERR_UNKNOWN;
|
return PORT_ERR_UNKNOWN;
|
||||||
|
@ -149,6 +149,9 @@ static port_err_t serial_setup(serial_t *h, const serial_baud_t baud,
|
||||||
#else /* __sun */
|
#else /* __sun */
|
||||||
h->newtio.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR
|
h->newtio.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR
|
||||||
| IGNCR | ICRNL | IXON);
|
| IGNCR | ICRNL | IXON);
|
||||||
|
if (port_parity)
|
||||||
|
h->newtio.c_iflag |= INPCK;
|
||||||
|
|
||||||
h->newtio.c_oflag &= ~OPOST;
|
h->newtio.c_oflag &= ~OPOST;
|
||||||
h->newtio.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
h->newtio.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
||||||
h->newtio.c_cflag &= ~(CSIZE | PARENB);
|
h->newtio.c_cflag &= ~(CSIZE | PARENB);
|
||||||
|
|
Loading…
Reference in New Issue