Browse Source

Move M43 to cpp

Scott Lahteine 8 years ago
parent
commit
be8d913484
3 changed files with 14 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 13
    2
      Marlin/src/gcode/config/M43.cpp
  3. 1
    4
      Marlin/src/gcode/gcode.cpp

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

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

Marlin/src/gcode/config/M43.h → Marlin/src/gcode/config/M43.cpp View File

@@ -20,9 +20,18 @@
20 20
  *
21 21
  */
22 22
 
23
-#include "../gcode.h"
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(PINS_DEBUGGING)
24 26
 
27
+#include "../gcode.h"
28
+#include "../../Marlin.h" // for pin_is_protected
25 29
 #include "../../pins/pinsDebug.h"
30
+#include "../../module/endstops.h"
31
+
32
+#if HAS_Z_SERVO_ENDSTOP
33
+  #include "../../module/probe.h"
34
+#endif
26 35
 
27 36
 inline void toggle_pins() {
28 37
   const bool I_flag = parser.boolval('I');
@@ -227,7 +236,7 @@ inline void servo_probe_test() {
227 236
  *  M43 S       - Servo probe test
228 237
  *                  P<index> - Probe index (optional - defaults to 0
229 238
  */
230
-void gcode_M43() {
239
+void GcodeSuite::M43() {
231 240
 
232 241
   if (parser.seen('T')) {   // must be first or else its "S" and "E" parameters will execute endstop or servo test
233 242
     toggle_pins();
@@ -311,3 +320,5 @@ void gcode_M43() {
311 320
   for (uint8_t pin = first_pin; pin <= last_pin; pin++)
312 321
     if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true);
313 322
 }
323
+
324
+#endif // PINS_DEBUGGING

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

@@ -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_M43();
121 120
 extern void gcode_M48();
122 121
 extern void gcode_M75();
123 122
 extern void gcode_M76();
@@ -435,11 +434,9 @@ void GcodeSuite::process_next_command() {
435 434
       case 42: M42(); break;      // M42: Change pin state
436 435
 
437 436
       #if ENABLED(PINS_DEBUGGING)
438
-        case 43: // M43: Read pin state
439
-          gcode_M43(); break;
437
+        case 43: M43(); break;    // M43: Read pin state
440 438
       #endif
441 439
 
442
-
443 440
       #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
444 441
         case 48: // M48: Z probe repeatability test
445 442
           gcode_M48();

Loading…
Cancel
Save