From 9bbf53875349c1fa6d5ff64526064b088e4d8c04 Mon Sep 17 00:00:00 2001 From: ArcherChang Date: Fri, 25 Aug 2017 15:36:37 +0800 Subject: [PATCH] =?UTF-8?q?[1]=20Andes=20N1068=E4=BD=93=E7=B3=BB=E7=A7=BB?= =?UTF-8?q?=E6=A4=8D=20=20=20=20=20a.=20=E6=81=A2=E5=A4=8D=E5=AF=B9finsh.h?= =?UTF-8?q?=E5=92=8Cshell.c=E7=9A=84=E4=BF=AE=E6=94=B9=EF=BC=9B=EF=BC=88?= =?UTF-8?q?=E8=8B=A5=E9=9C=80=E8=A6=81=E5=9C=A8Andes=20AE210P=E9=87=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8Finsh=EF=BC=8C=E8=AF=B7=E5=8F=82=E7=85=A7bsp/?= =?UTF-8?q?AE210P/readme/readme=E5=81=9A=E4=BF=AE=E6=94=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/finsh/finsh.h | 4 +--- components/finsh/shell.c | 13 +++++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h index 68a37f2da5..e80eaab178 100644 --- a/components/finsh/finsh.h +++ b/components/finsh/finsh.h @@ -72,9 +72,7 @@ typedef unsigned long u_long; /* only for GNU GCC */ #if !(defined(__GNUC__) && defined(__x86_64__)) -//typedef unsigned int size_t; -#include -#include +typedef unsigned int size_t; #else #include #endif diff --git a/components/finsh/shell.c b/components/finsh/shell.c index 434b2a0952..ae0934f5d1 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -311,11 +311,10 @@ void finsh_thread_entry(void *parameter) if (shell->device == RT_NULL) { #ifdef RT_USING_CONSOLE - shell->device = rt_console_get_device(); - RT_ASSERT(shell->device); -// rt_device_set_rx_indicate(shell->device, finsh_rx_ind); -// rt_device_open(shell->device, (RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX)); - rt_device_open(shell->device, (RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM)); + shell->device = rt_console_get_device(); + RT_ASSERT(shell->device); + rt_device_set_rx_indicate(shell->device, finsh_rx_ind); + rt_device_open(shell->device, (RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_INT_RX)); #else RT_ASSERT(shell->device); #endif @@ -324,7 +323,7 @@ void finsh_thread_entry(void *parameter) while (1) { /* wait receive */ -// if (rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER) != RT_EOK) continue; + if (rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER) != RT_EOK) continue; /* read one character from device */ while (rt_device_read(shell->device, 0, &ch, 1) == 1) @@ -551,8 +550,6 @@ void finsh_thread_entry(void *parameter) shell->line_curpos = 0; } } /* end of device read */ - - rt_thread_delay(1); } } -- GitLab