From ed9fe956a742a356bdd4b654b256830b310bacca Mon Sep 17 00:00:00 2001 From: midopple Date: Mon, 23 Apr 2012 07:56:14 +0200 Subject: Ignore ":" in comments. --- Sprinter/Sprinter.pde | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 13d0745..0589015 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -910,7 +910,7 @@ void get_command() while( Serial.available() > 0 && buflen < BUFSIZE) { serial_char = Serial.read(); - if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1) ) + if(serial_char == '\n' || serial_char == '\r' || (serial_char == ':' && comment_mode == false) || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line comment_mode = false; // for new command @@ -1021,7 +1021,7 @@ void get_command() serial_char = file.read(); read_char_int = (int)serial_char; - if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1) || read_char_int == -1) + if(serial_char == '\n' || serial_char == '\r' || (serial_char == ':' && comment_mode == false) || serial_count >= (MAX_CMD_SIZE - 1) || read_char_int == -1) { sdpos = file.curPosition(); if(sdpos >= filesize) -- cgit v1.2.1