From 013e5bd4111ac8b88957b48d98be44c0afa045e1 Mon Sep 17 00:00:00 2001 From: armink Date: Fri, 23 Feb 2018 15:24:27 +0800 Subject: [PATCH] [Components][Finsh] Add shell getchar received error process. --- components/finsh/shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/finsh/shell.c b/components/finsh/shell.c index d1fadd7221..2a0637ec2c 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -541,8 +541,8 @@ void finsh_thread_entry(void *parameter) } } - /* handle CR key */ - if (ch == '\0') continue; + /* received null or error */ + if (ch == '\0' || ch == 0xFF) continue; /* handle tab key */ else if (ch == '\t') {