From dcb4cdaa9e974b19b377e00a640017467a6d4b54 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 25 Apr 2016 18:23:09 -0700 Subject: [PATCH] Call report_current_position instead of gcode_M114 directly --- Marlin/Marlin_main.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6b0f52b6a9..287b86896f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -504,7 +504,7 @@ void serial_echopair_P(const char* s_P, float v) { serialprintPGM(s_P); void serial_echopair_P(const char* s_P, double v) { serialprintPGM(s_P); SERIAL_ECHO(v); } void serial_echopair_P(const char* s_P, unsigned long v) { serialprintPGM(s_P); SERIAL_ECHO(v); } -void gcode_M114(); +static void report_current_position(); #if ENABLED(DEBUG_LEVELING_FEATURE) void print_xyz(const char* prefix, const float x, const float y, const float z) { @@ -2886,8 +2886,7 @@ inline void gcode_G28() { } #endif - gcode_M114(); // Send end position to RepetierHost - + report_current_position(); } #if ENABLED(MESH_BED_LEVELING) @@ -3595,8 +3594,7 @@ inline void gcode_G28() { } #endif - gcode_M114(); // Send end position to RepetierHost - + report_current_position(); } #if DISABLED(Z_PROBE_SLED) // could be avoided @@ -3632,7 +3630,7 @@ inline void gcode_G28() { #endif stow_z_probe(false); // Retract Z Servo endstop if available. Z_PROBE_SLED is missed here. - gcode_M114(); // Send end position to RepetierHost + report_current_position(); } #endif //!Z_PROBE_SLED @@ -4229,7 +4227,7 @@ inline void gcode_M42() { clean_up_after_endstop_move(); - gcode_M114(); // Send end position to RepetierHost + report_current_position(); } #endif // AUTO_BED_LEVELING_FEATURE && Z_MIN_PROBE_REPEATABILITY_TEST @@ -4878,9 +4876,9 @@ inline void gcode_M92() { } /** - * M114: Output current position to serial port + * Output the current position to serial */ -inline void gcode_M114() { +static void report_current_position() { SERIAL_PROTOCOLPGM("X:"); SERIAL_PROTOCOL(current_position[X_AXIS]); SERIAL_PROTOCOLPGM(" Y:"); @@ -4941,6 +4939,11 @@ inline void gcode_M114() { #endif } +/** + * M114: Output current position to serial port + */ +inline void gcode_M114() { report_current_position(); } + /** * M115: Capabilities string */