fix a bug when readline from uart

This commit is contained in:
funshine 2014-12-26 11:17:54 +08:00
parent 2321ee972b
commit 1a7884c24e
1 changed files with 5 additions and 6 deletions

View File

@ -648,11 +648,6 @@ void ICACHE_FLASH_ATTR readline(lua_Load *load){
else else
continue; continue;
} }
/* other control character or not an acsii character */
else if (ch < 0x20 || ch >= 0x80)
{
continue;
}
/* end of line */ /* end of line */
if (ch == '\r' || ch == '\n') 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 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 */ /* echo */
if(uart0_echo) uart_putc(ch); if(uart0_echo) uart_putc(ch);
load->line[load->line_position] = ch; load->line[load->line_position] = ch;