Browse Source

Move M540 to cpp

Scott Lahteine 8 years ago
parent
commit
7ba2ab4fb3
3 changed files with 15 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 14
    2
      Marlin/src/gcode/config/M540.cpp
  3. 1
    4
      Marlin/src/gcode/gcode.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 ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
363
-  #include "gcode/config/M540.h"
364
-#endif
365
-
366
 #if ENABLED(MK2_MULTIPLEXER)
362
 #if ENABLED(MK2_MULTIPLEXER)
367
   #include "gcode/feature/snmm/M702.h"
363
   #include "gcode/feature/snmm/M702.h"
368
 #endif
364
 #endif

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

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/stepper.h"
29
+
23
 /**
30
 /**
24
  * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
31
  * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
25
  */
32
  */
26
-void gcode_M540() {
27
-  if (parser.seen('S')) stepper.abort_on_endstop_hit = parser.value_bool();
33
+void GcodeSuite::M540() {
34
+
35
+  if (parser.seen('S'))
36
+    stepper.abort_on_endstop_hit = parser.value_bool();
37
+
28
 }
38
 }
39
+
40
+#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED

+ 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_M540();
126
 extern void gcode_M605();
125
 extern void gcode_M605();
127
 extern void gcode_M702();
126
 extern void gcode_M702();
128
 extern void gcode_M900();
127
 extern void gcode_M900();
637
       #endif
636
       #endif
638
 
637
 
639
       #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
638
       #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
640
-        case 540: // M540: Set abort on endstop hit for SD printing
641
-          gcode_M540();
642
-          break;
639
+        case 540: M540(); break;  // M540: Set abort on endstop hit for SD printing
643
       #endif
640
       #endif
644
 
641
 
645
       #if HAS_BED_PROBE
642
       #if HAS_BED_PROBE

Loading…
Cancel
Save