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,14 +721,7 @@ void get_command()
721 721
           case 1:
722 722
           case 2:
723 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 725
               SERIAL_ERRORLNPGM(MSG_ERR_STOPPED);
733 726
               LCD_MESSAGEPGM(MSG_STOPPED);
734 727
             }
@@ -1357,7 +1350,6 @@ void process_commands()
1357 1350
           #endif //FWRETRACT
1358 1351
         prepare_move();
1359 1352
         //ClearToSend();
1360
-        return;
1361 1353
       }
1362 1354
       break;
1363 1355
 #ifndef SCARA //disable arc support
@@ -1365,14 +1357,12 @@ void process_commands()
1365 1357
       if(Stopped == false) {
1366 1358
         get_arc_coordinates();
1367 1359
         prepare_arc_move(true);
1368
-        return;
1369 1360
       }
1370 1361
       break;
1371 1362
     case 3: // G3  - CCW ARC
1372 1363
       if(Stopped == false) {
1373 1364
         get_arc_coordinates();
1374 1365
         prepare_arc_move(false);
1375
-        return;
1376 1366
       }
1377 1367
       break;
1378 1368
 #endif

Loading…
Cancel
Save