Move M540 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 15:26:15 -05:00
parent a90c7dbf64
commit 7ba2ab4fb3
3 changed files with 15 additions and 10 deletions

View File

@ -359,10 +359,6 @@ void quickstop_stepper() {
SYNC_PLAN_POSITION_KINEMATIC(); SYNC_PLAN_POSITION_KINEMATIC();
} }
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#include "gcode/config/M540.h"
#endif
#if ENABLED(MK2_MULTIPLEXER) #if ENABLED(MK2_MULTIPLEXER)
#include "gcode/feature/snmm/M702.h" #include "gcode/feature/snmm/M702.h"
#endif #endif

View File

@ -20,9 +20,21 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
#include "../gcode.h"
#include "../../module/stepper.h"
/** /**
* M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>) * M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
*/ */
void gcode_M540() { void GcodeSuite::M540() {
if (parser.seen('S')) stepper.abort_on_endstop_hit = parser.value_bool();
if (parser.seen('S'))
stepper.abort_on_endstop_hit = parser.value_bool();
} }
#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED

View File

@ -122,7 +122,6 @@ extern void gcode_M165();
extern void gcode_M350(); extern void gcode_M350();
extern void gcode_M351(); extern void gcode_M351();
extern void gcode_M355(); extern void gcode_M355();
extern void gcode_M540();
extern void gcode_M605(); extern void gcode_M605();
extern void gcode_M702(); extern void gcode_M702();
extern void gcode_M900(); extern void gcode_M900();
@ -637,9 +636,7 @@ void GcodeSuite::process_next_command() {
#endif #endif
#if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED) #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
case 540: // M540: Set abort on endstop hit for SD printing case 540: M540(); break; // M540: Set abort on endstop hit for SD printing
gcode_M540();
break;
#endif #endif
#if HAS_BED_PROBE #if HAS_BED_PROBE