Parcourir la source

Move M48 to cpp

Scott Lahteine il y a 7 ans
Parent
révision
fc52fc72ac
3 fichiers modifiés avec 17 ajouts et 10 suppressions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 15
    1
      Marlin/src/gcode/calibrate/M48.cpp
  3. 2
    5
      Marlin/src/gcode/gcode.cpp

+ 0
- 4
Marlin/src/Marlin.cpp Voir le fichier

@@ -370,10 +370,6 @@ bool pin_is_protected(const int8_t pin) {
370 370
   return false;
371 371
 }
372 372
 
373
-#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
374
-  #include "gcode/calibrate/M48.h"
375
-#endif
376
-
377 373
 #include "gcode/stats/M75.h"
378 374
 #include "gcode/stats/M76.h"
379 375
 #include "gcode/stats/M77.h"

Marlin/src/gcode/calibrate/M48.h → Marlin/src/gcode/calibrate/M48.cpp Voir le fichier

@@ -20,6 +20,18 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/motion.h"
29
+#include "../../module/probe.h"
30
+
31
+#if DISABLED(DELTA)
32
+  #include "../../feature/bedlevel/bedlevel.h"
33
+#endif
34
+
23 35
 /**
24 36
  * M48: Z probe repeatability measurement function.
25 37
  *
@@ -38,7 +50,7 @@
38 50
  * Any information generated by a prior G29 Bed leveling command will be lost and need to be
39 51
  * regenerated.
40 52
  */
41
-void gcode_M48() {
53
+void GcodeSuite::M48() {
42 54
 
43 55
   if (axis_unhomed_error()) return;
44 56
 
@@ -271,3 +283,5 @@ void gcode_M48() {
271 283
 
272 284
   report_current_position();
273 285
 }
286
+
287
+#endif // Z_MIN_PROBE_REPEATABILITY_TEST

+ 2
- 5
Marlin/src/gcode/gcode.cpp Voir le fichier

@@ -117,7 +117,6 @@ void GcodeSuite::dwell(millis_t time) {
117 117
 // Placeholders for non-migrated codes
118 118
 //
119 119
 extern void gcode_M18_M84();
120
-extern void gcode_M48();
121 120
 extern void gcode_M75();
122 121
 extern void gcode_M76();
123 122
 extern void gcode_M77();
@@ -438,10 +437,8 @@ void GcodeSuite::process_next_command() {
438 437
       #endif
439 438
 
440 439
       #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
441
-        case 48: // M48: Z probe repeatability test
442
-          gcode_M48();
443
-          break;
444
-      #endif // Z_MIN_PROBE_REPEATABILITY_TEST
440
+        case 48: M48(); break;    // M48: Z probe repeatability test
441
+      #endif
445 442
 
446 443
       #if ENABLED(UBL_G26_MESH_VALIDATION)
447 444
         case 49: M49(); break;    // M49: Turn on or off G26 debug flag for verbose output

Chargement…
Annuler
Enregistrer