1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-24 04:29:34 +00:00

Move M666 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 02:25:52 -05:00
parent f5877aa93e
commit 6c7bad8bc3
3 changed files with 18 additions and 12 deletions

View File

@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
return false; return false;
} }
#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
#include "gcode/calibrate/M666.h"
#endif
#include "gcode/control/M211.h" #include "gcode/control/M211.h"
#include "gcode/config/M220.h" #include "gcode/config/M220.h"

View File

@ -20,15 +20,24 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
#include "../gcode.h"
#if ENABLED(DELTA) #if ENABLED(DELTA)
#include "../../module/delta.h"
#include "../../module/motion.h"
/** /**
* M666: Set delta endstop adjustment * M666: Set delta endstop adjustment
*/ */
void gcode_M666() { void GcodeSuite::M666() {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOLNPGM(">>> gcode_M666"); SERIAL_ECHOLNPGM(">>> M666");
} }
#endif #endif
LOOP_XYZ(i) { LOOP_XYZ(i) {
@ -44,7 +53,7 @@
} }
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOLNPGM("<<< gcode_M666"); SERIAL_ECHOLNPGM("<<< M666");
} }
#endif #endif
// normalize endstops so all are <=0; set the residue to delta height // normalize endstops so all are <=0; set the residue to delta height
@ -55,12 +64,16 @@
#elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS) #elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS)
#include "../../Marlin.h" // for z_endstop_adj
/** /**
* M666: For Z Dual Endstop setup, set z axis offset to the z2 axis. * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
*/ */
void gcode_M666() { void GcodeSuite::M666() {
if (parser.seen('Z')) z_endstop_adj = parser.value_linear_units(); if (parser.seen('Z')) z_endstop_adj = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj); SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
} }
#endif #endif
#endif // DELTA || Z_DUAL_ENDSTOPS

View File

@ -151,7 +151,6 @@ extern void gcode_M502();
extern void gcode_M503(); extern void gcode_M503();
extern void gcode_M540(); extern void gcode_M540();
extern void gcode_M605(); extern void gcode_M605();
extern void gcode_M666();
extern void gcode_M702(); extern void gcode_M702();
extern void gcode_M900(); extern void gcode_M900();
extern void gcode_M906(); extern void gcode_M906();
@ -544,9 +543,7 @@ void GcodeSuite::process_next_command() {
#endif #endif
#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)
case 666: // M666: Set delta or dual endstop adjustment case 666: M666(); break; // M666: Set delta or dual endstop adjustment
gcode_M666();
break;
#endif #endif
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)