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
   return false;
370
   return false;
371
 }
371
 }
372
 
372
 
373
-#if ENABLED(PINS_DEBUGGING)
374
-  #include "gcode/config/M43.h"
375
-#endif
376
-
377
 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
373
 #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
378
   #include "gcode/calibrate/M48.h"
374
   #include "gcode/calibrate/M48.h"
379
 #endif
375
 #endif

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

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
 #include "../../pins/pinsDebug.h"
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
 inline void toggle_pins() {
36
 inline void toggle_pins() {
28
   const bool I_flag = parser.boolval('I');
37
   const bool I_flag = parser.boolval('I');
227
  *  M43 S       - Servo probe test
236
  *  M43 S       - Servo probe test
228
  *                  P<index> - Probe index (optional - defaults to 0
237
  *                  P<index> - Probe index (optional - defaults to 0
229
  */
238
  */
230
-void gcode_M43() {
239
+void GcodeSuite::M43() {
231
 
240
 
232
   if (parser.seen('T')) {   // must be first or else its "S" and "E" parameters will execute endstop or servo test
241
   if (parser.seen('T')) {   // must be first or else its "S" and "E" parameters will execute endstop or servo test
233
     toggle_pins();
242
     toggle_pins();
311
   for (uint8_t pin = first_pin; pin <= last_pin; pin++)
320
   for (uint8_t pin = first_pin; pin <= last_pin; pin++)
312
     if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true);
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
 // Placeholders for non-migrated codes
117
 // Placeholders for non-migrated codes
118
 //
118
 //
119
 extern void gcode_M18_M84();
119
 extern void gcode_M18_M84();
120
-extern void gcode_M43();
121
 extern void gcode_M48();
120
 extern void gcode_M48();
122
 extern void gcode_M75();
121
 extern void gcode_M75();
123
 extern void gcode_M76();
122
 extern void gcode_M76();
435
       case 42: M42(); break;      // M42: Change pin state
434
       case 42: M42(); break;      // M42: Change pin state
436
 
435
 
437
       #if ENABLED(PINS_DEBUGGING)
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
       #endif
438
       #endif
441
 
439
 
442
-
443
       #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
440
       #if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
444
         case 48: // M48: Z probe repeatability test
441
         case 48: // M48: Z probe repeatability test
445
           gcode_M48();
442
           gcode_M48();

Loading…
Cancel
Save