Merge pull request #487 from ArdaFu/master

[finsh] Clear buffer before switching to new shell device
This commit is contained in:
Bernard Xiong 2015-05-22 17:38:25 +08:00
commit ac66401a25
1 changed files with 5 additions and 1 deletions

View File

@ -123,6 +123,10 @@ void finsh_set_device(const char* device_name)
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;
rt_device_set_rx_indicate(dev, finsh_rx_ind);
}