Ignore ":" in comments.

This commit is contained in:
midopple 2012-04-23 07:56:14 +02:00
parent 3a29ee97d1
commit ed9fe956a7

View file

@ -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)