提交 ac66401a 编写于 作者: B Bernard Xiong

Merge pull request #487 from ArdaFu/master

[finsh] Clear buffer before switching to new shell device
...@@ -122,7 +122,11 @@ void finsh_set_device(const char* device_name) ...@@ -122,7 +122,11 @@ void finsh_set_device(const char* device_name)
rt_device_close(shell->device); rt_device_close(shell->device);
rt_device_set_rx_indicate(shell->device, RT_NULL); rt_device_set_rx_indicate(shell->device, RT_NULL);
} }
/* clear line buffer before switch to new device */
memset(shell->line, 0, sizeof(shell->line));
shell->line_curpos = shell->line_position = 0;
shell->device = dev; shell->device = dev;
rt_device_set_rx_indicate(dev, finsh_rx_ind); rt_device_set_rx_indicate(dev, finsh_rx_ind);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册