summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard <[email protected]>2013-08-19 12:46:04 +0800
committerbernard <[email protected]>2013-08-19 12:46:04 +0800
commitfa934fa7bd3a4843e73b905003e5143bda8b43d4 (patch)
tree5405c572a7bad197d5f1946ef132d7e8c3cb42ce
parentdce51ddf053e4173c420dccd5b22d80f57e18a2e (diff)
add shell device automatically setting for rx_ind
-rw-r--r--components/finsh/shell.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c
index ba5d0e4d77..19dd93691e 100644
--- a/components/finsh/shell.c
+++ b/components/finsh/shell.c
@@ -376,6 +376,14 @@ void finsh_thread_entry(void* parameter)
finsh_init(&shell->parser);
rt_kprintf(FINSH_PROMPT);
+ /* set console device as shell device */
+ shell->device = rt_console_get_device();
+ if (shell->device != RT_NULL)
+ {
+ rt_device_open(shell->device, RT_DEVICE_OFLAG_RDWR);
+ rt_device_set_rx_indicate(shell->device, finsh_rx_ind);
+ }
+
while (1)
{
/* wait receive */