Browse Source

Make M125 work with SDSUPPORT (#12289)

Scott Lahteine 6 years ago
parent
commit
42f8b6c530
No account linked to committer's email address
2 changed files with 16 additions and 29 deletions
  1. 8
    17
      Marlin/src/gcode/feature/pause/M125.cpp
  2. 8
    12
      Marlin/src/sd/cardreader.h

+ 8
- 17
Marlin/src/gcode/feature/pause/M125.cpp View File

@@ -28,10 +28,8 @@
28 28
 #include "../../parser.h"
29 29
 #include "../../../feature/pause.h"
30 30
 #include "../../../module/motion.h"
31
-
32
-#if DISABLED(SDSUPPORT)
33
-  #include "../../../module/printcounter.h"
34
-#endif
31
+#include "../../../sd/cardreader.h"
32
+#include "../../../module/printcounter.h"
35 33
 
36 34
 /**
37 35
  * M125: Store current position and move to filament change position.
@@ -70,21 +68,14 @@ void GcodeSuite::M125() {
70 68
     park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
71 69
   #endif
72 70
 
73
-  #if DISABLED(SDSUPPORT)
74
-    const bool job_running = print_job_timer.isRunning();
75
-  #endif
76
-
77
-  if (pause_print(retract, park_point)) {
78
-    #if DISABLED(SDSUPPORT)
79
-      // Wait for lcd click or M108
80
-      wait_for_filament_reload();
71
+  const bool job_running = print_job_timer.isRunning();
81 72
 
82
-      // Return to print position and continue
83
-      resume_print();
84
-
85
-      if (job_running) print_job_timer.start();
86
-    #endif
73
+  if (pause_print(retract, park_point) && !IS_SD_PRINTING()) {
74
+    wait_for_filament_reload(); // Wait for lcd click or M108
75
+    resume_print();             // Return to print position and continue
87 76
   }
77
+
78
+  if (job_running) print_job_timer.start();
88 79
 }
89 80
 
90 81
 #endif // PARK_HEAD_ON_PAUSE

+ 8
- 12
Marlin/src/sd/cardreader.h View File

@@ -19,9 +19,7 @@
19 19
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 20
  *
21 21
  */
22
-
23
-#ifndef _CARDREADER_H_
24
-#define _CARDREADER_H_
22
+#pragma once
25 23
 
26 24
 #include "../inc/MarlinConfig.h"
27 25
 
@@ -265,16 +263,14 @@ private:
265 263
   #define IS_SD_INSERTED() true
266 264
 #endif
267 265
 
266
+#define IS_SD_PRINTING()  card.sdprinting
267
+#define IS_SD_FILE_OPEN() card.isFileOpen()
268
+
268 269
 extern CardReader card;
269 270
 
270
-#endif // SDSUPPORT
271
+#else // !SDSUPPORT
271 272
 
272
-#if ENABLED(SDSUPPORT)
273
-  #define IS_SD_PRINTING()  card.sdprinting
274
-  #define IS_SD_FILE_OPEN() card.isFileOpen()
275
-#else
276
-  #define IS_SD_PRINTING()  false
277
-  #define IS_SD_FILE_OPEN() false
278
-#endif
273
+#define IS_SD_PRINTING()  false
274
+#define IS_SD_FILE_OPEN() false
279 275
 
280
-#endif // _CARDREADER_H_
276
+#endif // !SDSUPPORT

Loading…
Cancel
Save