Browse Source

Move G38 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
84ddae56a8
  1. 4
      Marlin/src/Marlin.cpp
  2. 3
      Marlin/src/gcode/gcode.cpp
  3. 2
      Marlin/src/gcode/gcode.h
  4. 15
      Marlin/src/gcode/probe/G38.cpp

4
Marlin/src/Marlin.cpp

@ -357,10 +357,6 @@ void suicide() {
***************** GCode Handlers ***************** ***************** GCode Handlers *****************
**************************************************/ **************************************************/
#if ENABLED(G38_PROBE_TARGET)
#include "gcode/probe/G38.h"
#endif
#if HAS_MESH #if HAS_MESH
#include "gcode/probe/G42.h" #include "gcode/probe/G42.h"
#endif #endif

3
Marlin/src/gcode/gcode.cpp

@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_G38(bool is_38_2);
extern void gcode_G42(); extern void gcode_G42();
extern void gcode_G92(); extern void gcode_G92();
extern void gcode_M0_M1(); extern void gcode_M0_M1();
@ -385,7 +384,7 @@ void GcodeSuite::process_next_command() {
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
case 38: // G38.2 & G38.3 case 38: // G38.2 & G38.3
if (parser.subcode == 2 || parser.subcode == 3) if (parser.subcode == 2 || parser.subcode == 3)
gcode_G38(parser.subcode == 2); G38(parser.subcode == 2);
break; break;
#endif #endif

2
Marlin/src/gcode/gcode.h

@ -375,7 +375,7 @@ private:
#endif #endif
#if ENABLED(G38_PROBE_TARGET) #if ENABLED(G38_PROBE_TARGET)
static void G38(bool is_38_2); static void G38(const bool is_38_2);
#endif #endif
#if HAS_MESH #if HAS_MESH

15
Marlin/src/gcode/probe/G38.h → Marlin/src/gcode/probe/G38.cpp

@ -20,8 +20,17 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(G38_PROBE_TARGET)
#include "../gcode.h" #include "../gcode.h"
#include "../../module/endstops.h"
#include "../../module/motion.h"
#include "../../module/stepper.h"
#include "../../module/probe.h"
static bool G38_run_probe() { static bool G38_run_probe() {
bool G38_pass_fail = false; bool G38_pass_fail = false;
@ -88,9 +97,9 @@ static bool G38_run_probe() {
* *
* Like G28 except uses Z min probe for all axes * Like G28 except uses Z min probe for all axes
*/ */
void gcode_G38(bool is_38_2) { void GcodeSuite::G38(const bool is_38_2) {
// Get X Y Z E F // Get X Y Z E F
gcode.get_destination_from_command(); get_destination_from_command();
setup_for_endstop_or_probe_move(); setup_for_endstop_or_probe_move();
@ -108,3 +117,5 @@ void gcode_G38(bool is_38_2) {
clean_up_after_endstop_or_probe_move(); clean_up_after_endstop_or_probe_move();
} }
#endif // G38_PROBE_TARGET
Loading…
Cancel
Save