Use st_get_position_mm where possible (PR#2411)
This commit is contained in:
parent
2e0da8abdc
commit
87a872e103
|
@ -2852,7 +2852,7 @@ inline void gcode_G28() {
|
|||
float x_tmp = current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
|
||||
y_tmp = current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER,
|
||||
z_tmp = current_position[Z_AXIS],
|
||||
real_z = (float)st_get_position(Z_AXIS) / axis_steps_per_unit[Z_AXIS]; //get the real Z (since the auto bed leveling is already correcting the plane)
|
||||
real_z = st_get_position_mm(Z_AXIS); //get the real Z (since the auto bed leveling is already correcting the plane)
|
||||
|
||||
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); // Apply the correction sending the probe offset
|
||||
//line below controls z probe offset, zprobe_zoffset is the actual offset that can be modified via m851 or is read from EEPROM
|
||||
|
@ -3909,11 +3909,11 @@ inline void gcode_M114() {
|
|||
SERIAL_PROTOCOL(current_position[E_AXIS]);
|
||||
|
||||
SERIAL_PROTOCOLPGM(MSG_COUNT_X);
|
||||
SERIAL_PROTOCOL(float(st_get_position(X_AXIS))/axis_steps_per_unit[X_AXIS]);
|
||||
SERIAL_PROTOCOL(st_get_position_mm(X_AXIS));
|
||||
SERIAL_PROTOCOLPGM(" Y:");
|
||||
SERIAL_PROTOCOL(float(st_get_position(Y_AXIS))/axis_steps_per_unit[Y_AXIS]);
|
||||
SERIAL_PROTOCOL(st_get_position_mm(Y_AXIS));
|
||||
SERIAL_PROTOCOLPGM(" Z:");
|
||||
SERIAL_PROTOCOL(float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]);
|
||||
SERIAL_PROTOCOL(st_get_position_mm(Z_AXIS));
|
||||
|
||||
SERIAL_EOL;
|
||||
|
||||
|
|
|
@ -1073,13 +1073,7 @@ long st_get_position(uint8_t axis) {
|
|||
return count_pos;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||
|
||||
float st_get_position_mm(AxisEnum axis) {
|
||||
return st_get_position(axis) / axis_steps_per_unit[axis];
|
||||
}
|
||||
|
||||
#endif // ENABLE_AUTO_BED_LEVELING
|
||||
float st_get_position_mm(AxisEnum axis) { return st_get_position(axis) / axis_steps_per_unit[axis]; }
|
||||
|
||||
void finishAndDisableSteppers() {
|
||||
st_synchronize();
|
||||
|
|
|
@ -66,10 +66,8 @@ void st_set_e_position(const long &e);
|
|||
// Get current position in steps
|
||||
long st_get_position(uint8_t axis);
|
||||
|
||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||
// Get current position in mm
|
||||
float st_get_position_mm(AxisEnum axis);
|
||||
#endif
|
||||
|
||||
// The stepper subsystem goes to sleep when it runs out of things to execute. Call this
|
||||
// to notify the subsystem that it is time to go to work.
|
||||
|
|
Loading…
Reference in a new issue