4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-18 21:13:32 +08:00

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

View File

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