mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 18:13:31 +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:
parent
7bdb082c91
commit
6d2df9bf94
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user