commit
efc536afec
|
@ -759,14 +759,17 @@ static rt_err_t rt_serial_close(struct rt_device *dev)
|
|||
#ifdef RT_SERIAL_USING_DMA
|
||||
else if (dev->open_flag & RT_DEVICE_FLAG_DMA_RX)
|
||||
{
|
||||
if (serial->config.bufsz == 0) {
|
||||
if (serial->config.bufsz == 0)
|
||||
{
|
||||
struct rt_serial_rx_dma* rx_dma;
|
||||
|
||||
rx_dma = (struct rt_serial_rx_dma*)serial->serial_rx;
|
||||
RT_ASSERT(rx_dma != RT_NULL);
|
||||
|
||||
rt_free(rx_dma);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
struct rt_serial_rx_fifo* rx_fifo;
|
||||
|
||||
rx_fifo = (struct rt_serial_rx_fifo*)serial->serial_rx;
|
||||
|
@ -1105,6 +1108,16 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
|
|||
break;
|
||||
case TCXONC:
|
||||
break;
|
||||
case TIOCSWINSZ:
|
||||
{
|
||||
struct winsize* p_winsize;
|
||||
|
||||
p_winsize = (struct winsize*)args;
|
||||
rt_enter_critical();
|
||||
rt_kprintf("\x1b[8;%d;%dt", p_winsize->ws_col, p_winsize->ws_row);
|
||||
rt_exit_critical();
|
||||
}
|
||||
break;
|
||||
#endif /*RT_USING_POSIX_TERMIOS*/
|
||||
case FIONREAD:
|
||||
{
|
||||
|
@ -1118,14 +1131,6 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
|
|||
*(rt_size_t *)args = recved;
|
||||
}
|
||||
break;
|
||||
case TIOCSWINSZ:
|
||||
{
|
||||
struct winsize* p_winsize;
|
||||
|
||||
p_winsize = (struct winsize*)args;
|
||||
rt_kprintf("\x1b[8;%d;%dt", p_winsize->ws_col, p_winsize->ws_row);
|
||||
}
|
||||
break;
|
||||
#endif /*RT_USING_POSIX*/
|
||||
default :
|
||||
/* control device */
|
||||
|
|
|
@ -227,4 +227,3 @@ struct winsize {
|
|||
#define SIOCPROTOPRIVATE 0x89E0
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue