Tweak G92 to call plan_set_position only once, yes?

This commit is contained in:
Scott Lahteine 2015-03-28 19:18:24 -07:00
parent f47fc879fe
commit 2b0c25a091

View File

@ -2494,15 +2494,17 @@ inline void gcode_G92() {
if (!code_seen(axis_codes[E_AXIS])) if (!code_seen(axis_codes[E_AXIS]))
st_synchronize(); st_synchronize();
bool didXYZ = false;
for (int i = 0; i < NUM_AXIS; i++) { for (int i = 0; i < NUM_AXIS; i++) {
if (code_seen(axis_codes[i])) { if (code_seen(axis_codes[i])) {
current_position[i] = code_value(); float v = current_position[i] = code_value();
if (i == E_AXIS) if (i == E_AXIS)
plan_set_e_position(current_position[E_AXIS]); plan_set_e_position(v);
else else
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]); didXYZ = true;
} }
} }
if (didXYZ) plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
} }
#ifdef ULTIPANEL #ifdef ULTIPANEL