mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
arch/risc-v/src/mpfs/mpfs_serial.c: Correct setting of nbits
Number of bits was set wrongly in TCSETS for mpfs Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
committed by
Xiang Xiao
parent
6ec006ee02
commit
9aea5d5dbb
@@ -907,22 +907,44 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
priv->stopbits2 = (termiosp->c_cflag & CSTOPB) != 0;
|
priv->stopbits2 = (termiosp->c_cflag & CSTOPB) != 0;
|
||||||
|
|
||||||
priv->bits = (termiosp->c_cflag & CS5) ? 5 : 0;
|
switch (termiosp->c_cflag & CSIZE)
|
||||||
priv->bits = (termiosp->c_cflag & CS6) ? 6 : 0;
|
{
|
||||||
priv->bits = (termiosp->c_cflag & CS7) ? 7 : 0;
|
case CS5:
|
||||||
priv->bits = (termiosp->c_cflag & CS8) ? 8 : 0;
|
priv->bits = 5;
|
||||||
|
break;
|
||||||
|
|
||||||
/* Note that only cfgetispeed is used because we have knowledge
|
case CS6:
|
||||||
* that only one speed is supported.
|
priv->bits = 6;
|
||||||
*/
|
break;
|
||||||
|
|
||||||
priv->baud = cfgetispeed(termiosp);
|
case CS7:
|
||||||
|
priv->bits = 7;
|
||||||
|
break;
|
||||||
|
|
||||||
/* Effect the changes immediately - note that we do not implement
|
case CS8:
|
||||||
* TCSADRAIN / TCSAFLUSH
|
priv->bits = 8;
|
||||||
*/
|
break;
|
||||||
|
|
||||||
up_set_format(dev);
|
default:
|
||||||
|
priv->bits = 0;
|
||||||
|
ret = -EINVAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == OK)
|
||||||
|
{
|
||||||
|
/* Note that only cfgetispeed is used because we have knowledge
|
||||||
|
* that only one speed is supported.
|
||||||
|
*/
|
||||||
|
|
||||||
|
priv->baud = cfgetispeed(termiosp);
|
||||||
|
|
||||||
|
/* Effect the changes immediately - note that we do not implement
|
||||||
|
* TCSADRAIN / TCSAFLUSH
|
||||||
|
*/
|
||||||
|
|
||||||
|
up_set_format(dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_SERIAL_TERMIOS */
|
#endif /* CONFIG_SERIAL_TERMIOS */
|
||||||
|
|||||||
Reference in New Issue
Block a user