From 1a7884c24e97bfbc5d5049e57d2a3260c9169078 Mon Sep 17 00:00:00 2001 From: funshine Date: Fri, 26 Dec 2014 11:17:54 +0800 Subject: [PATCH] fix a bug when readline from uart --- app/lua/lua.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/lua/lua.c b/app/lua/lua.c index 6eab7724..24807a08 100644 --- a/app/lua/lua.c +++ b/app/lua/lua.c @@ -648,11 +648,6 @@ void ICACHE_FLASH_ATTR readline(lua_Load *load){ else continue; } - /* other control character or not an acsii character */ - else if (ch < 0x20 || ch >= 0x80) - { - continue; - } /* end of line */ if (ch == '\r' || ch == '\n') { @@ -675,7 +670,11 @@ void ICACHE_FLASH_ATTR readline(lua_Load *load){ os_timer_arm(&lua_timer, READLINE_INTERVAL, 0); // no repeat } } - + /* other control character or not an acsii character */ + if (ch < 0x20 || ch >= 0x80) + { + continue; + } /* echo */ if(uart0_echo) uart_putc(ch); load->line[load->line_position] = ch;