Browse Source

Move G12 to cpp

Scott Lahteine 7 years ago
parent
commit
94d9def81c
3 changed files with 14 additions and 7 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 13
    1
      Marlin/src/gcode/feature/clean/G12.cpp
  3. 1
    2
      Marlin/src/gcode/gcode.cpp

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

@@ -361,10 +361,6 @@ void suicide() {
361 361
  ***************** GCode Handlers *****************
362 362
  **************************************************/
363 363
 
364
-#if ENABLED(NOZZLE_CLEAN_FEATURE)
365
-  #include "gcode/feature/clean/G12.h"
366
-#endif
367
-
368 364
 #if ENABLED(CNC_WORKSPACE_PLANES)
369 365
   #include "gcode/geometry/G17-G19.h"
370 366
 #endif

Marlin/src/gcode/feature/clean/G12.h → Marlin/src/gcode/feature/clean/G12.cpp View File

@@ -20,10 +20,20 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(NOZZLE_CLEAN_FEATURE)
26
+
27
+#include "../../../libs/nozzle.h"
28
+
29
+#include "../../gcode.h"
30
+#include "../../parser.h"
31
+#include "../../../module/motion.h"
32
+
23 33
 /**
24 34
  * G12: Clean the nozzle
25 35
  */
26
-void gcode_G12() {
36
+void GcodeSuite::G12() {
27 37
   // Don't allow nozzle cleaning without homing first
28 38
   if (axis_unhomed_error()) return;
29 39
 
@@ -34,3 +44,5 @@ void gcode_G12() {
34 44
 
35 45
   Nozzle::clean(pattern, strokes, radius, objects);
36 46
 }
47
+
48
+#endif // NOZZLE_CLEAN_FEATURE

+ 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_G12();
116 115
 extern void gcode_G17();
117 116
 extern void gcode_G18();
118 117
 extern void gcode_G19();
@@ -313,7 +312,7 @@ void GcodeSuite::process_next_command() {
313 312
 
314 313
       #if ENABLED(NOZZLE_CLEAN_FEATURE)
315 314
         case 12:
316
-          gcode_G12(); // G12: Nozzle Clean
315
+          G12(); // G12: Nozzle Clean
317 316
           break;
318 317
       #endif // NOZZLE_CLEAN_FEATURE
319 318
 

Loading…
Cancel
Save