From 7f03b1ac71dbdaae1cf5659d3515bf2febd05bd2 Mon Sep 17 00:00:00 2001 From: LiuYan Date: Fri, 2 Jun 2023 16:21:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E4=B8=8D=E5=90=AF=E7=94=A8=20RT=5FUSI?= =?UTF-8?q?NG=5FDEVICE=20=E6=97=B6=E4=B8=8D=E5=88=9B=E5=BB=BA=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E9=98=BB=E5=A1=9Eshell=E7=BA=BF=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E9=87=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/finsh/shell.c | 3 ++- components/finsh/shell.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 0d41625184..7d7bce68b0 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 e6b1921c60..4a2cc76589 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; -- Gitee