Browse Source

Ignore ":" in comments.

Erik van der Zalm 13 years ago
parent
commit
0c1b863755
1 changed files with 8 additions and 2 deletions
  1. 8
    2
      Marlin/Marlin.pde

+ 8
- 2
Marlin/Marlin.pde View File

346
 { 
346
 { 
347
   while( MYSERIAL.available() > 0  && buflen < BUFSIZE) {
347
   while( MYSERIAL.available() > 0  && buflen < BUFSIZE) {
348
     serial_char = MYSERIAL.read();
348
     serial_char = MYSERIAL.read();
349
-    if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1) ) 
349
+    if(serial_char == '\n' || 
350
+       serial_char == '\r' || 
351
+       (serial_char == ':' && comment_mode == false) || 
352
+       serial_count >= (MAX_CMD_SIZE - 1) ) 
350
     {
353
     {
351
       if(!serial_count) { //if empty line
354
       if(!serial_count) { //if empty line
352
         comment_mode = false; //for new command
355
         comment_mode = false; //for new command
453
   while( !card.eof()  && buflen < BUFSIZE) {
456
   while( !card.eof()  && buflen < BUFSIZE) {
454
     int16_t n=card.get();
457
     int16_t n=card.get();
455
     serial_char = (char)n;
458
     serial_char = (char)n;
456
-    if(serial_char == '\n' || serial_char == '\r' || serial_char == ':' || serial_count >= (MAX_CMD_SIZE - 1)||n==-1) 
459
+    if(serial_char == '\n' || 
460
+       serial_char == '\r' || 
461
+       (serial_char == ':' && comment_mode == false) || 
462
+       serial_count >= (MAX_CMD_SIZE - 1)||n==-1) 
457
     {
463
     {
458
       if(card.eof()){
464
       if(card.eof()){
459
         SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
465
         SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);

Loading…
Cancel
Save