diff options
author | kliment <kliment.yanev@gmail.com> | 2012-02-23 14:12:18 -0800 |
---|---|---|
committer | kliment <kliment.yanev@gmail.com> | 2012-02-23 14:12:18 -0800 |
commit | 6d5a3297f45908bcfa2e10d242d05550a67c123f (patch) | |
tree | 1f754c357bb26b7b6d340cbf9955b9492ddd77f2 | |
parent | 00559b532ab1509b80a501e9525707b26a1c2b13 (diff) | |
parent | d85e549549bbb01092df783c21752ac7583c45ce (diff) |
Merge pull request #142 from jschleic/fix-comment_mode
fix comment mode.
-rw-r--r-- | Sprinter/Sprinter.pde | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 0462c95..c35258a 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -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) { @@ -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 } |