Browse Source

Drop obsolete SD special char handling

See #14035
Scott Lahteine 5 years ago
parent
commit
5296af94d2
1 changed files with 3 additions and 22 deletions
  1. 3
    22
      Marlin/src/gcode/queue.cpp

+ 3
- 22
Marlin/src/gcode/queue.cpp View File

491
    * can also interrupt buffering.
491
    * can also interrupt buffering.
492
    */
492
    */
493
   inline void GCodeQueue::get_sdcard_commands() {
493
   inline void GCodeQueue::get_sdcard_commands() {
494
-    static bool stop_buffering = false,
494
+    static bool sd_comment_mode = false
495
-                sd_comment_mode = false
496
                 #if ENABLED(PAREN_COMMENTS)
495
                 #if ENABLED(PAREN_COMMENTS)
497
                   , sd_comment_paren_mode = false
496
                   , sd_comment_paren_mode = false
498
                 #endif
497
                 #endif
500
 
499
 
501
     if (!IS_SD_PRINTING()) return;
500
     if (!IS_SD_PRINTING()) return;
502
 
501
 
503
-    /**
504
-     * '#' stops reading from SD to the buffer prematurely, so procedural
505
-     * macro calls are possible. If it occurs, stop_buffering is triggered
506
-     * and the buffer is run dry; this character _can_ occur in serial com
507
-     * due to checksums, however, no checksums are used in SD printing.
508
-     */
509
-
510
-    if (length == 0) stop_buffering = false;
511
-
512
     uint16_t sd_count = 0;
502
     uint16_t sd_count = 0;
513
     bool card_eof = card.eof();
503
     bool card_eof = card.eof();
514
-    while (length < BUFSIZE && !card_eof && !stop_buffering) {
504
+    while (length < BUFSIZE && !card_eof) {
515
       const int16_t n = card.get();
505
       const int16_t n = card.get();
516
       char sd_char = (char)n;
506
       char sd_char = (char)n;
517
       card_eof = card.eof();
507
       card_eof = card.eof();
518
-      if (card_eof || n == -1
508
+      if (card_eof || n == -1 || sd_char == '\n' || sd_char == '\r') {
519
-          || sd_char == '\n' || sd_char == '\r'
520
-          || ((sd_char == '#' || sd_char == ':') && !sd_comment_mode
521
-            #if ENABLED(PAREN_COMMENTS)
522
-              && !sd_comment_paren_mode
523
-            #endif
524
-          )
525
-      ) {
526
         if (card_eof) {
509
         if (card_eof) {
527
 
510
 
528
           card.printingHasFinished();
511
           card.printingHasFinished();
548
         else if (n == -1)
531
         else if (n == -1)
549
           SERIAL_ERROR_MSG(MSG_SD_ERR_READ);
532
           SERIAL_ERROR_MSG(MSG_SD_ERR_READ);
550
 
533
 
551
-        if (sd_char == '#') stop_buffering = true;
552
-
553
         sd_comment_mode = false; // for new command
534
         sd_comment_mode = false; // for new command
554
         #if ENABLED(PAREN_COMMENTS)
535
         #if ENABLED(PAREN_COMMENTS)
555
           sd_comment_paren_mode = false;
536
           sd_comment_paren_mode = false;

Loading…
Cancel
Save