finsh: unregister rx_indicate when closing the device

Because the device could still remain opened when closed by finsh, the
old rx_indicate is useless for finsh. Some buggy driver will still
generate rx_indicate even after the device has been closed. So FinSh
should unregister the rx_indicate when releasing the old device.
This commit is contained in:
Grissiom 2013-09-22 22:12:04 +08:00
parent 7bdb082c91
commit 6d2df9bf94
1 changed files with 1 additions and 0 deletions

View File

@ -131,6 +131,7 @@ void finsh_set_device(const char* device_name)
{
/* close old finsh device */
rt_device_close(shell->device);
rt_device_set_rx_indicate(dev, RT_NULL);
}
shell->device = dev;