Browse Source

Pause SD queue early on M25 (#21317)

Scott Lahteine 4 years ago
parent
commit
71f2617263
No account linked to committer's email address
3 changed files with 14 additions and 1 deletions
  1. 3
    0
      Marlin/src/gcode/host/M115.cpp
  2. 7
    1
      Marlin/src/gcode/queue.cpp
  3. 4
    0
      Marlin/src/gcode/sd/M24_M25.cpp

+ 3
- 0
Marlin/src/gcode/host/M115.cpp View File

120
     // REPEAT (M808)
120
     // REPEAT (M808)
121
     cap_line(PSTR("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
121
     cap_line(PSTR("REPEAT"), ENABLED(GCODE_REPEAT_MARKERS));
122
 
122
 
123
+    // SD_WRITE (M928, M28, M29)
124
+    cap_line(PSTR("SD_WRITE"), ENABLED(SDSUPPORT) && DISABLED(SDCARD_READONLY));
125
+
123
     // AUTOREPORT_SD_STATUS (M27 extension)
126
     // AUTOREPORT_SD_STATUS (M27 extension)
124
     cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
127
     cap_line(PSTR("AUTOREPORT_SD_STATUS"), ENABLED(AUTO_REPORT_SD_STATUS));
125
 
128
 

+ 7
- 1
Marlin/src/gcode/queue.cpp View File

567
       const bool is_eol = ISEOL(sd_char);
567
       const bool is_eol = ISEOL(sd_char);
568
       if (is_eol || card_eof) {
568
       if (is_eol || card_eof) {
569
 
569
 
570
-
571
         // Reset stream state, terminate the buffer, and commit a non-empty command
570
         // Reset stream state, terminate the buffer, and commit a non-empty command
572
         if (!is_eol && sd_count) ++sd_count;          // End of file with no newline
571
         if (!is_eol && sd_count) ++sd_count;          // End of file with no newline
573
         if (!process_line_done(sd_input_state, command.buffer, sd_count)) {
572
         if (!process_line_done(sd_input_state, command.buffer, sd_count)) {
575
           // M808 L saves the sdpos of the next line. M808 loops to a new sdpos.
574
           // M808 L saves the sdpos of the next line. M808 loops to a new sdpos.
576
           TERN_(GCODE_REPEAT_MARKERS, repeat.early_parse_M808(command.buffer));
575
           TERN_(GCODE_REPEAT_MARKERS, repeat.early_parse_M808(command.buffer));
577
 
576
 
577
+          #if DISABLED(PARK_HEAD_ON_PAUSE)
578
+            // When M25 is non-blocking it can still suspend SD commands
579
+            // Otherwise the M125 handler needs to know SD printing is active
580
+            if (command.buffer[0] == 'M' && command.buffer[1] == '2' && command.buffer[2] == '5' && !NUMERIC(command.buffer[3]))
581
+              card.pauseSDPrint();
582
+          #endif
583
+
578
           // Put the new command into the buffer (no "ok" sent)
584
           // Put the new command into the buffer (no "ok" sent)
579
           ring_buffer.commit_command(true);
585
           ring_buffer.commit_command(true);
580
 
586
 

+ 4
- 0
Marlin/src/gcode/sd/M24_M25.cpp View File

87
 
87
 
88
 /**
88
 /**
89
  * M25: Pause SD Print
89
  * M25: Pause SD Print
90
+ *
91
+ * With PARK_HEAD_ON_PAUSE:
92
+ *   Invoke M125 to store the current position and move to the park
93
+ *   position. M24 will move the head back before resuming the print.
90
  */
94
  */
91
 void GcodeSuite::M25() {
95
 void GcodeSuite::M25() {
92
 
96
 

Loading…
Cancel
Save