support both CR and LF and CRLF line termination

This commit is contained in:
Simen Svale Skogsrud 2010-07-02 23:23:32 +02:00
parent 5613aa706f
commit 2f847a1f33

View File

@ -50,7 +50,7 @@ void sp_process()
char c; char c;
while((c = serialRead()) != -1) while((c = serialRead()) != -1)
{ {
if((c == '\n')) { // Line is complete. Then execute! if((char_counter > 0) && ((c == '\n') || (c == '\r'))) { // Line is complete. Then execute!
line[char_counter] = 0; line[char_counter] = 0;
printString(line); printPgmString(PSTR("\r\n")); printString(line); printPgmString(PSTR("\r\n"));
gc_execute_line(line); gc_execute_line(line);