Browse Source

Move M428 to cpp

Scott Lahteine 8 years ago
parent
commit
aab5489962
3 changed files with 14 additions and 9 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    4
      Marlin/src/gcode/gcode.cpp
  3. 13
    1
      Marlin/src/gcode/geometry/M428.cpp

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

359
   SYNC_PLAN_POSITION_KINEMATIC();
359
   SYNC_PLAN_POSITION_KINEMATIC();
360
 }
360
 }
361
 
361
 
362
-#if HAS_M206_COMMAND
363
-  #include "gcode/geometry/M428.h"
364
-#endif
365
-
366
 #include "gcode/eeprom/M500.h"
362
 #include "gcode/eeprom/M500.h"
367
 #include "gcode/eeprom/M501.h"
363
 #include "gcode/eeprom/M501.h"
368
 #include "gcode/eeprom/M502.h"
364
 #include "gcode/eeprom/M502.h"

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

122
 extern void gcode_M350();
122
 extern void gcode_M350();
123
 extern void gcode_M351();
123
 extern void gcode_M351();
124
 extern void gcode_M355();
124
 extern void gcode_M355();
125
-extern void gcode_M428();
126
 extern void gcode_M500();
125
 extern void gcode_M500();
127
 extern void gcode_M501();
126
 extern void gcode_M501();
128
 extern void gcode_M502();
127
 extern void gcode_M502();
631
       #endif
630
       #endif
632
 
631
 
633
       #if HAS_M206_COMMAND
632
       #if HAS_M206_COMMAND
634
-        case 428: // M428: Apply current_position to home_offset
635
-          gcode_M428();
636
-          break;
633
+        case 428: M428(); break;  // M428: Apply current_position to home_offset
637
       #endif
634
       #endif
638
 
635
 
639
       case 500: // M500: Store settings in EEPROM
636
       case 500: // M500: Store settings in EEPROM

Marlin/src/gcode/geometry/M428.h → Marlin/src/gcode/geometry/M428.cpp View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if HAS_M206_COMMAND
26
+
27
+#include "../gcode.h"
28
+#include "../../module/motion.h"
29
+#include "../../lcd/ultralcd.h"
30
+#include "../../libs/buzzer.h"
31
+#include "../../Marlin.h" // for axis_homed
32
+
23
 /**
33
 /**
24
  * M428: Set home_offset based on the distance between the
34
  * M428: Set home_offset based on the distance between the
25
  *       current_position and the nearest "reference point."
35
  *       current_position and the nearest "reference point."
31
  *
41
  *
32
  *       Use M206 to set these values directly.
42
  *       Use M206 to set these values directly.
33
  */
43
  */
34
-void gcode_M428() {
44
+void GcodeSuite::M428() {
35
   bool err = false;
45
   bool err = false;
36
   LOOP_XYZ(i) {
46
   LOOP_XYZ(i) {
37
     if (axis_homed[i]) {
47
     if (axis_homed[i]) {
59
     BUZZ(100, 698);
69
     BUZZ(100, 698);
60
   }
70
   }
61
 }
71
 }
72
+
73
+#endif // HAS_M206_COMMAND

Loading…
Cancel
Save