Support odd parity.
This commit is contained in:
committed by
Kim Woelders
parent
2c090f3721
commit
4223a4b92a
+11
-5
@@ -691,10 +691,12 @@ static unsigned int _tio_parity(const struct termios2 *tio)
|
||||
{
|
||||
unsigned int par;
|
||||
|
||||
if ((tio->c_cflag & PARENB) && (tio->c_iflag & IGNPAR))
|
||||
if (!(tio->c_cflag & PARENB))
|
||||
{
|
||||
par = 1;
|
||||
}
|
||||
#ifdef CMSPAR
|
||||
else if ((tio->c_cflag & PARENB) && (tio->c_iflag & CMSPAR))
|
||||
else if (tio->c_iflag & CMSPAR)
|
||||
{
|
||||
if (tio->c_cflag & PARODD)
|
||||
par = 4;
|
||||
@@ -702,10 +704,14 @@ static unsigned int _tio_parity(const struct termios2 *tio)
|
||||
par = 5;
|
||||
}
|
||||
#endif
|
||||
else if (tio->c_cflag & PARENB)
|
||||
par = 3;
|
||||
else if (tio->c_cflag & PARODD)
|
||||
{
|
||||
par = 2;
|
||||
}
|
||||
else
|
||||
par = 1;
|
||||
{
|
||||
par = 3;
|
||||
}
|
||||
|
||||
return par;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user