mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-30 15:26:18 +00:00
Fix G92 so it only sets the plan position once
This commit is contained in:
parent
3db5a75f30
commit
c7df961144
@ -1427,6 +1427,7 @@ inline void sync_plan_position() {
|
|||||||
#endif
|
#endif
|
||||||
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
||||||
}
|
}
|
||||||
|
inline void sync_plan_position_e() { plan_set_e_position(current_position[E_AXIS]); }
|
||||||
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
|
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
|
||||||
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
|
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
|
||||||
|
|
||||||
@ -3642,8 +3643,9 @@ inline void gcode_G28() {
|
|||||||
* G92: Set current position to given X Y Z E
|
* G92: Set current position to given X Y Z E
|
||||||
*/
|
*/
|
||||||
inline void gcode_G92() {
|
inline void gcode_G92() {
|
||||||
if (!code_seen(axis_codes[E_AXIS]))
|
bool didE = code_seen(axis_codes[E_AXIS]);
|
||||||
st_synchronize();
|
|
||||||
|
if (!didE) st_synchronize();
|
||||||
|
|
||||||
bool didXYZ = false;
|
bool didXYZ = false;
|
||||||
for (int i = 0; i < NUM_AXIS; i++) {
|
for (int i = 0; i < NUM_AXIS; i++) {
|
||||||
@ -3653,12 +3655,9 @@ inline void gcode_G92() {
|
|||||||
|
|
||||||
current_position[i] = v;
|
current_position[i] = v;
|
||||||
|
|
||||||
if (i == E_AXIS)
|
if (i != E_AXIS) {
|
||||||
plan_set_e_position(v);
|
|
||||||
else {
|
|
||||||
position_shift[i] += v - p; // Offset the coordinate space
|
position_shift[i] += v - p; // Offset the coordinate space
|
||||||
update_software_endstops((AxisEnum)i);
|
update_software_endstops((AxisEnum)i);
|
||||||
|
|
||||||
didXYZ = true;
|
didXYZ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3670,6 +3669,9 @@ inline void gcode_G92() {
|
|||||||
sync_plan_position();
|
sync_plan_position();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else if (didE) {
|
||||||
|
sync_plan_position_e();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(ULTIPANEL)
|
#if ENABLED(ULTIPANEL)
|
||||||
|
Loading…
Reference in New Issue
Block a user