Call report_current_position instead of gcode_M114 directly

This commit is contained in:
Scott Lahteine 2016-04-25 18:23:09 -07:00
parent df2d0eb37c
commit dcb4cdaa9e

View File

@ -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
*/