From 0c1b863755d1e2af9022a5c2563c309535c97e40 Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Sun, 25 Mar 2012 14:41:26 +0200 Subject: [PATCH] Ignore ":" in comments. --- Marlin/Marlin.pde | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin.pde b/Marlin/Marlin.pde index 5ee40c038c..ce11d7ba2b 100644 --- a/Marlin/Marlin.pde +++ b/Marlin/Marlin.pde @@ -346,7 +346,10 @@ void get_command() { while( MYSERIAL.available() > 0 && buflen < BUFSIZE) { serial_char = MYSERIAL.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 @@ -453,7 +456,10 @@ void get_command() while( !card.eof() && buflen < BUFSIZE) { int16_t n=card.get(); serial_char = (char)n; - if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1)||n==-1) + if(serial_char == '\n' || + serial_char == '\r' || + (serial_char == ':' && comment_mode == false) || + serial_count >= (MAX_CMD_SIZE - 1)||n==-1) { if(card.eof()){ SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);