File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
components/drivers/serial Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 2424 * 2018-12-08 Ernest Chen add DMA choice
2525 * 2020-09-14 WillianChan add a line feed to the carriage return character
2626 * when using interrupt tx
27+ * 2020-12-14 Meco Man add function of setting window's size(TIOCSWINSZ)
2728 */
2829
2930#include <rthw.h>
@@ -1009,7 +1010,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
10091010 }
10101011
10111012 break ;
1012-
1013+ #ifdef RT_USING_POSIX
10131014#ifdef RT_USING_POSIX_TERMIOS
10141015 case TCGETA :
10151016 {
@@ -1101,8 +1102,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
11011102 break ;
11021103 case TCXONC :
11031104 break ;
1104- #endif
1105- #ifdef RT_USING_POSIX
1105+ #endif /*RT_USING_POSIX_TERMIOS*/
11061106 case FIONREAD :
11071107 {
11081108 rt_size_t recved = 0 ;
@@ -1115,7 +1115,15 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
11151115 * (rt_size_t * )args = recved ;
11161116 }
11171117 break ;
1118- #endif
1118+ case TIOCSWINSZ :
1119+ {
1120+ struct winsize * p_winsize ;
1121+
1122+ p_winsize = (struct winsize * )args ;
1123+ rt_kprintf ("\x1b[8;%d;%dt" , p_winsize -> ws_col , p_winsize -> ws_row );
1124+ }
1125+ break ;
1126+ #endif /*RT_USING_POSIX*/
11191127 default :
11201128 /* control device */
11211129 ret = serial -> ops -> control (serial , cmd , args );
You can’t perform that action at this time.
0 commit comments