Merge pull request #201 from prife/master
finsh: fix finsh device setting
This commit is contained in:
commit
6c58f80a1d
@ -308,11 +308,16 @@ void finsh_thread_entry(void* parameter)
|
|||||||
rt_kprintf(FINSH_PROMPT);
|
rt_kprintf(FINSH_PROMPT);
|
||||||
|
|
||||||
/* set console device as shell device */
|
/* 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_open(shell->device, RT_DEVICE_OFLAG_RDWR);
|
||||||
rt_device_set_rx_indicate(shell->device, finsh_rx_ind);
|
rt_device_set_rx_indicate(shell->device, finsh_rx_ind);
|
||||||
|
#else
|
||||||
|
RT_ASSERT(shell->device);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user