diff options
| author | Bernard Xiong <[email protected]> | 2013-11-18 16:13:19 -0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2013-11-18 16:13:19 -0800 |
| commit | 6c58f80a1d83f6970de28fb445b7b9a989ff8b84 (patch) | |
| tree | e526f2a20ad1d58dd4e66315ea8a1d4e74d1b1a2 | |
| parent | 52d49c7dc645511a84119ebb4581aa9e3e66443f (diff) | |
| parent | b79b9be19f73733e2796ab35457360fda2a13633 (diff) | |
Merge pull request #201 from prife/master
finsh: fix finsh device setting
| -rw-r--r-- | components/finsh/shell.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 9793108a17..fcb34878aa 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -308,11 +308,16 @@ void finsh_thread_entry(void* parameter) rt_kprintf(FINSH_PROMPT); /* set console device as shell device */ - shell->device = rt_console_get_device(); - if (shell->device != RT_NULL) + if (shell->device == RT_NULL) { +#ifdef RT_USING_CONSOLE + shell->device = rt_console_get_device(); + RT_ASSERT(shell->device); rt_device_open(shell->device, RT_DEVICE_OFLAG_RDWR); rt_device_set_rx_indicate(shell->device, finsh_rx_ind); +#else + RT_ASSERT(shell->device); +#endif } while (1) |
