diff --git a/serial_protocol.c b/serial_protocol.c index 3e246f1..1557f53 100644 --- a/serial_protocol.c +++ b/serial_protocol.c @@ -50,7 +50,7 @@ void sp_process() char c; 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; printString(line); printPgmString(PSTR("\r\n")); gc_execute_line(line);