Browse Source

Move M0_M1 to cpp

Scott Lahteine 6 years ago
parent
commit
04583d46af
3 changed files with 17 additions and 9 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    2
      Marlin/src/gcode/gcode.cpp
  3. 16
    3
      Marlin/src/gcode/lcd/M0_M1.cpp

+ 0
- 4
Marlin/src/Marlin.cpp View File

357
  ***************** GCode Handlers *****************
357
  ***************** GCode Handlers *****************
358
  **************************************************/
358
  **************************************************/
359
 
359
 
360
-#if HAS_RESUME_CONTINUE
361
-  #include "gcode/lcd/M0_M1.h"
362
-#endif
363
-
364
 #if ENABLED(SPINDLE_LASER_ENABLE)
360
 #if ENABLED(SPINDLE_LASER_ENABLE)
365
   #include "gcode/control/M3-M5.h"
361
   #include "gcode/control/M3-M5.h"
366
 #endif
362
 #endif

+ 1
- 2
Marlin/src/gcode/gcode.cpp View File

116
 //
116
 //
117
 // Placeholders for non-migrated codes
117
 // Placeholders for non-migrated codes
118
 //
118
 //
119
-extern void gcode_M0_M1();
120
 extern void gcode_M3_M4(bool is_M3);
119
 extern void gcode_M3_M4(bool is_M3);
121
 extern void gcode_M5();
120
 extern void gcode_M5();
122
 extern void gcode_M17();
121
 extern void gcode_M17();
413
       #if HAS_RESUME_CONTINUE
412
       #if HAS_RESUME_CONTINUE
414
         case 0: // M0: Unconditional stop - Wait for user button press on LCD
413
         case 0: // M0: Unconditional stop - Wait for user button press on LCD
415
         case 1: // M1: Conditional stop - Wait for user button press on LCD
414
         case 1: // M1: Conditional stop - Wait for user button press on LCD
416
-          gcode_M0_M1();
415
+          M0_M1();
417
           break;
416
           break;
418
       #endif // ULTIPANEL
417
       #endif // ULTIPANEL
419
 
418
 

Marlin/src/gcode/lcd/M0_M1.h → Marlin/src/gcode/lcd/M0_M1.cpp View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_RESUME_CONTINUE
26
+
23
 #include "../gcode.h"
27
 #include "../gcode.h"
28
+#include "../../module/stepper.h"
29
+
30
+#if ENABLED(ULTIPANEL)
31
+  #include "../../lcd/ultralcd.h"
32
+#endif
33
+
34
+#include "../../sd/cardreader.h"
24
 
35
 
25
 /**
36
 /**
26
  * M0: Unconditional stop - Wait for user button press on LCD
37
  * M0: Unconditional stop - Wait for user button press on LCD
27
  * M1: Conditional stop   - Wait for user button press on LCD
38
  * M1: Conditional stop   - Wait for user button press on LCD
28
  */
39
  */
29
-void gcode_M0_M1() {
40
+void GcodeSuite::M0_M1() {
30
   const char * const args = parser.string_arg;
41
   const char * const args = parser.string_arg;
31
 
42
 
32
   millis_t ms = 0;
43
   millis_t ms = 0;
64
   wait_for_user = true;
75
   wait_for_user = true;
65
 
76
 
66
   stepper.synchronize();
77
   stepper.synchronize();
67
-  gcode.refresh_cmd_timeout();
78
+  refresh_cmd_timeout();
68
 
79
 
69
   if (ms > 0) {
80
   if (ms > 0) {
70
-    ms += gcode.previous_cmd_ms;  // wait until this time for a click
81
+    ms += previous_cmd_ms;  // wait until this time for a click
71
     while (PENDING(millis(), ms) && wait_for_user) idle();
82
     while (PENDING(millis(), ms) && wait_for_user) idle();
72
   }
83
   }
73
   else {
84
   else {
84
   wait_for_user = false;
95
   wait_for_user = false;
85
   KEEPALIVE_STATE(IN_HANDLER);
96
   KEEPALIVE_STATE(IN_HANDLER);
86
 }
97
 }
98
+
99
+#endif // HAS_RESUME_CONTINUE

Loading…
Cancel
Save