set min read length in uart_ioctl

set min read length in uart_ioctl

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
This commit is contained in:
zhanghu5 2024-01-25 18:49:16 +08:00 committed by Xiang Xiao
parent 7a495fabb6
commit 10e7d8fe44
1 changed files with 5 additions and 0 deletions

View File

@ -1060,6 +1060,10 @@ static ssize_t uart_read(FAR struct file *filep,
{
ret = nxsem_wait(&dev->recvsem);
}
#ifdef CONFIG_SERIAL_TERMIOS
dev->minrecv = dev->minread;
#endif
}
leave_critical_section(flags);
@ -1579,6 +1583,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_SERIAL_TERMIOS
dev->timeout = termiosp->c_cc[VTIME];
dev->minread = termiosp->c_cc[VMIN];
dev->minrecv = dev->minread;
#endif
ret = 0;
}