diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 0d416251843f99c55a0ce36efac2a10a76dc1947..7d7bce68b0345409bc15019e377897aec208625e 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -883,8 +883,9 @@ int finsh_system_init(void) &finsh_thread_stack[0], sizeof(finsh_thread_stack), FINSH_THREAD_PRIORITY, 10); #endif /* RT_USING_HEAP */ - +#ifdef RT_USING_DEVICE rt_sem_init(&(shell->rx_sem), "shrx", 0, 0); +#endif finsh_set_prompt_mode(1); if (tid != NULL && result == RT_EOK) diff --git a/components/finsh/shell.h b/components/finsh/shell.h index e6b1921c603db9e2104d8f283982843395032ed1..4a2cc765898fde40b44e52e9182d974138cd4203 100644 --- a/components/finsh/shell.h +++ b/components/finsh/shell.h @@ -60,7 +60,9 @@ enum input_stat }; struct finsh_shell { +#ifdef RT_USING_DEVICE struct rt_semaphore rx_sem; +#endif enum input_stat stat;