Merge pull request #142 from jschleic/fix-comment_mode

fix comment mode.
This commit is contained in:
kliment 2012-02-23 14:12:18 -08:00
commit 6d5a3297f4

View file

@ -414,9 +414,11 @@ inline void get_command()
serial_char = Serial.read(); 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 == ':' || serial_count >= (MAX_CMD_SIZE - 1) )
{ {
if(!serial_count) return; //if empty line if(!serial_count) { //if empty line
comment_mode = false; // for new command
return;
}
cmdbuffer[bufindw][serial_count] = 0; //terminate string cmdbuffer[bufindw][serial_count] = 0; //terminate string
if(!comment_mode){
fromsd[bufindw] = false; fromsd[bufindw] = false;
if(strstr(cmdbuffer[bufindw], "N") != NULL) if(strstr(cmdbuffer[bufindw], "N") != NULL)
{ {
@ -488,7 +490,6 @@ inline void get_command()
bufindw = (bufindw + 1)%BUFSIZE; bufindw = (bufindw + 1)%BUFSIZE;
buflen += 1; buflen += 1;
}
comment_mode = false; //for new command comment_mode = false; //for new command
serial_count = 0; //clear buffer serial_count = 0; //clear buffer
} }