From 6d2df9bf9400acd6716a2a3c0b5c02f7973cc43c Mon Sep 17 00:00:00 2001 From: Grissiom Date: Sun, 22 Sep 2013 22:12:04 +0800 Subject: [PATCH] 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. --- components/finsh/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 19dd93691e..8ff0e89e44 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -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;