Browse Source

Fixes commands not being acknowledged in the same order they are received

in

G0 to G3 were previously acknowledged in the get_command method, causing
them to be possibly acknowledged before commands coming after them that
were acknowledged in process_commands.

This patch fixes this, moving the acknowledgement of G0 to G3 to the
process_commands method as well. These commands are therefore no
longer acknowledged when the enter the cmd_buffer but instead only
acknowledged when the enter the plan_buffer.

Guaranteeing that commands are acknowledged in the same order in which
they were received by the firmware allows host software to be able to
track the life cycle of commands and such a better management of the
firmware's serial buffers as well as better internal command processing
and response parsing without having to depend on throwing an epic
amount of regular expressions against each line received back from the
firmware.

Fixes ErikZalm/Marlin#1147
Gina Häußge 10 years ago
parent
commit
acc0e75279
1 changed files with 1 additions and 11 deletions
  1. 1
    11
      Marlin/Marlin_main.cpp

+ 1
- 11
Marlin/Marlin_main.cpp View File

721
           case 1:
721
           case 1:
722
           case 2:
722
           case 2:
723
           case 3:
723
           case 3:
724
-            if(Stopped == false) { // If printer is stopped by an error the G[0-3] codes are ignored.
725
-          #ifdef SDSUPPORT
726
-              if(card.saving)
727
-                break;
728
-          #endif //SDSUPPORT
729
-              SERIAL_PROTOCOLLNPGM(MSG_OK);
730
-            }
731
-            else {
724
+            if (Stopped == true) {
732
               SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
725
               SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
733
               LCD_MESSAGEPGM(MSG_STOPPED);
726
               LCD_MESSAGEPGM(MSG_STOPPED);
734
             }
727
             }
1357
           #endif //FWRETRACT
1350
           #endif //FWRETRACT
1358
         prepare_move();
1351
         prepare_move();
1359
         //ClearToSend();
1352
         //ClearToSend();
1360
-        return;
1361
       }
1353
       }
1362
       break;
1354
       break;
1363
 #ifndef SCARA //disable arc support
1355
 #ifndef SCARA //disable arc support
1365
       if(Stopped == false) {
1357
       if(Stopped == false) {
1366
         get_arc_coordinates();
1358
         get_arc_coordinates();
1367
         prepare_arc_move(true);
1359
         prepare_arc_move(true);
1368
-        return;
1369
       }
1360
       }
1370
       break;
1361
       break;
1371
     case 3: // G3  - CCW ARC
1362
     case 3: // G3  - CCW ARC
1372
       if(Stopped == false) {
1363
       if(Stopped == false) {
1373
         get_arc_coordinates();
1364
         get_arc_coordinates();
1374
         prepare_arc_move(false);
1365
         prepare_arc_move(false);
1375
-        return;
1376
       }
1366
       }
1377
       break;
1367
       break;
1378
 #endif
1368
 #endif

Loading…
Cancel
Save