Browse Source

Move G20_G21 to cpp

Scott Lahteine 7 years ago
parent
commit
a1ee1628e5
3 changed files with 12 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 2
    4
      Marlin/src/gcode/gcode.cpp
  3. 10
    2
      Marlin/src/gcode/units/G20_G21.cpp

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

@@ -357,10 +357,6 @@ void suicide() {
357 357
  ***************** GCode Handlers *****************
358 358
  **************************************************/
359 359
 
360
-#if ENABLED(INCH_MODE_SUPPORT)
361
-  #include "gcode/units/G20_G21.h"
362
-#endif
363
-
364 360
 #if ENABLED(NOZZLE_PARK_FEATURE)
365 361
   #include "gcode/feature/pause/G27.h"
366 362
 #endif

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

@@ -116,8 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
116 116
 //
117 117
 // Placeholders for non-migrated codes
118 118
 //
119
-extern void gcode_G20();
120
-extern void gcode_G21();
121 119
 extern void gcode_G27();
122 120
 extern void gcode_G30();
123 121
 extern void gcode_G31();
@@ -331,11 +329,11 @@ void GcodeSuite::process_next_command() {
331 329
 
332 330
       #if ENABLED(INCH_MODE_SUPPORT)
333 331
         case 20: // G20: Inch Mode
334
-          gcode_G20();
332
+          G20();
335 333
           break;
336 334
 
337 335
         case 21: // G21: MM Mode
338
-          gcode_G21();
336
+          G21();
339 337
           break;
340 338
       #endif // INCH_MODE_SUPPORT
341 339
 

Marlin/src/gcode/units/G20_G21.h → Marlin/src/gcode/units/G20_G21.cpp View File

@@ -20,12 +20,20 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(INCH_MODE_SUPPORT)
26
+
27
+#include "../gcode.h"
28
+
23 29
 /**
24 30
  * G20: Set input mode to inches
25 31
  */
26
-void gcode_G20() { parser.set_input_linear_units(LINEARUNIT_INCH); }
32
+void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); }
27 33
 
28 34
 /**
29 35
  * G21: Set input mode to millimeters
30 36
  */
31
-void gcode_G21() { parser.set_input_linear_units(LINEARUNIT_MM); }
37
+void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); }
38
+
39
+#endif // INCH_MODE_SUPPORT

Loading…
Cancel
Save