Skip to content

Commit

Permalink
Merge pull request #142 from jschleic/fix-comment_mode
Browse files Browse the repository at this point in the history
fix comment mode.
  • Loading branch information
kliment committed Feb 23, 2012
2 parents 00559b5 + d85e549 commit 6d5a329
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Sprinter/Sprinter.pde
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,11 @@ inline void get_command()
serial_char = Serial.read();
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
if(!comment_mode){
fromsd[bufindw] = false;
if(strstr(cmdbuffer[bufindw], "N") != NULL)
{
Expand Down Expand Up @@ -488,7 +490,6 @@ inline void get_command()
bufindw = (bufindw + 1)%BUFSIZE;
buflen += 1;

}
comment_mode = false; //for new command
serial_count = 0; //clear buffer
}
Expand Down

0 comments on commit 6d5a329

Please sign in to comment.