Browse Source

Move G4 to cpp

Scott Lahteine 7 years ago
parent
commit
760f29a88e
4 changed files with 8 additions and 7 deletions
  1. 0
    2
      Marlin/src/Marlin.cpp
  2. 1
    2
      Marlin/src/gcode/gcode.cpp
  3. 1
    1
      Marlin/src/gcode/gcode.h
  4. 6
    2
      Marlin/src/gcode/motion/G4.cpp

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

@@ -365,8 +365,6 @@ void suicide() {
365 365
  ***************** GCode Handlers *****************
366 366
  **************************************************/
367 367
 
368
-#include "gcode/motion/G4.h"
369
-
370 368
 #if ENABLED(BEZIER_CURVE_SUPPORT)
371 369
   #include "gcode/motion/G5.h"
372 370
 #endif

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

@@ -112,7 +112,6 @@ void GcodeSuite::dwell(millis_t time) {
112 112
 //
113 113
 // Placeholders for non-migrated codes
114 114
 //
115
-extern void gcode_G4();
116 115
 extern void gcode_G5();
117 116
 extern void gcode_G12();
118 117
 extern void gcode_G17();
@@ -295,7 +294,7 @@ void GcodeSuite::process_next_command() {
295 294
 
296 295
       // G4 Dwell
297 296
       case 4:
298
-        gcode_G4();
297
+        G4();
299 298
         break;
300 299
 
301 300
       #if ENABLED(BEZIER_CURVE_SUPPORT)

+ 1
- 1
Marlin/src/gcode/gcode.h View File

@@ -299,7 +299,7 @@ public:
299 299
     #define KEEPALIVE_STATE(n) NOOP
300 300
   #endif
301 301
 
302
-  void dwell(millis_t time);
302
+  static void dwell(millis_t time);
303 303
 
304 304
 private:
305 305
 

Marlin/src/gcode/motion/G4.h → Marlin/src/gcode/motion/G4.cpp View File

@@ -20,10 +20,14 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../gcode.h"
24
+#include "../../module/stepper.h"
25
+#include "../../lcd/ultralcd.h"
26
+
23 27
 /**
24 28
  * G4: Dwell S<seconds> or P<milliseconds>
25 29
  */
26
-void gcode_G4() {
30
+void GcodeSuite::G4() {
27 31
   millis_t dwell_ms = 0;
28 32
 
29 33
   if (parser.seenval('P')) dwell_ms = parser.value_millis(); // milliseconds to wait
@@ -33,5 +37,5 @@ void gcode_G4() {
33 37
 
34 38
   if (!lcd_hasstatus()) LCD_MESSAGEPGM(MSG_DWELL);
35 39
 
36
-  gcode.dwell(dwell_ms);
40
+  dwell(dwell_ms);
37 41
 }

Loading…
Cancel
Save