Browse Source

Move M665 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
f5877aa93e
  1. 4
      Marlin/src/Marlin.cpp
  2. 17
      Marlin/src/gcode/calibrate/M665.cpp
  3. 5
      Marlin/src/gcode/gcode.cpp

4
Marlin/src/Marlin.cpp

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

17
Marlin/src/gcode/calibrate/M665.h → Marlin/src/gcode/calibrate/M665.cpp

@ -20,8 +20,17 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if IS_KINEMATIC
#include "../gcode.h"
#include "../../module/motion.h"
#if ENABLED(DELTA)
#include "../../module/delta.h"
/**
* M665: Set delta configurations
*
@ -34,7 +43,7 @@
* Y = Beta (Tower 2) angle trim
* Z = Rotate A and B by this angle
*/
void gcode_M665() {
void GcodeSuite::M665() {
if (parser.seen('H')) {
home_offset[Z_AXIS] = parser.value_linear_units() - DELTA_HEIGHT;
update_software_endstops(Z_AXIS);
@ -54,6 +63,8 @@
#elif IS_SCARA
#include "../../module/scara.h"
/**
* M665: Set SCARA settings
*
@ -66,7 +77,7 @@
* A, P, and X are all aliases for the shoulder angle
* B, T, and Y are all aliases for the elbow angle
*/
void gcode_M665() {
void GcodeSuite::M665() {
if (parser.seen('S')) delta_segments_per_second = parser.value_float();
const bool hasA = parser.seen('A'), hasP = parser.seen('P'), hasX = parser.seen('X');
@ -91,3 +102,5 @@
}
#endif
#endif // IS_KINEMATIC

5
Marlin/src/gcode/gcode.cpp

@ -151,7 +151,6 @@ extern void gcode_M502();
extern void gcode_M503();
extern void gcode_M540();
extern void gcode_M605();
extern void gcode_M665();
extern void gcode_M666();
extern void gcode_M702();
extern void gcode_M900();
@ -541,9 +540,7 @@ void GcodeSuite::process_next_command() {
#endif
#if ENABLED(DELTA)
case 665: // M665: Set delta configurations
gcode_M665();
break;
case 665: M665(); break; // M665: Set delta configurations
#endif
#if ENABLED(DELTA) || ENABLED(Z_DUAL_ENDSTOPS)

Loading…
Cancel
Save