Move M206 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 01:43:20 -05:00
parent 7aca9fe2f7
commit 33861d4e04
3 changed files with 11 additions and 9 deletions

View File

@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#if HAS_M206_COMMAND
#include "gcode/geometry/M206.h"
#endif
#if IS_KINEMATIC
#include "gcode/calibrate/M665.h"
#endif

View File

@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) {
extern void gcode_M163();
extern void gcode_M164();
extern void gcode_M165();
extern void gcode_M206();
extern void gcode_M211();
extern void gcode_M220();
extern void gcode_M226();
@ -538,9 +537,7 @@ void GcodeSuite::process_next_command() {
case 205: M205(); break; // M205: Set advanced settings
#if HAS_M206_COMMAND
case 206: // M206: Set home offsets
gcode_M206();
break;
case 206: M206(); break; // M206: Set home offsets
#endif
#if ENABLED(DELTA)

View File

@ -20,6 +20,13 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if HAS_M206_COMMAND
#include "../gcode.h"
#include "../../module/motion.h"
/**
* M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y
*
@ -27,7 +34,7 @@
* *** M206 for SCARA will remain enabled in 1.1.x for compatibility.
* *** In the 2.0 release, it will simply be disabled by default.
*/
void gcode_M206() {
void GcodeSuite::M206() {
LOOP_XYZ(i)
if (parser.seen(axis_codes[i]))
set_home_offset((AxisEnum)i, parser.value_linear_units());
@ -40,3 +47,5 @@ void gcode_M206() {
SYNC_PLAN_POSITION_KINEMATIC();
report_current_position();
}
#endif // HAS_M206_COMMAND