Optimisation: Set lastpos using memcpy directly

Verified the change by running the M600 gcode. All axis move as expected.

Change in memory:
Flash: -64 bytes
SRAM: 0 bytes
This commit is contained in:
Guðni Már Gilbert 2022-09-04 12:59:59 +00:00 committed by D.R.racer
parent f984072eab
commit db1b0ea9ac
1 changed files with 1 additions and 4 deletions

View File

@ -3536,10 +3536,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
float HotendTempBckp = degTargetHotend(active_extruder);
int fanSpeedBckp = fanSpeed;
lastpos[X_AXIS] = current_position[X_AXIS];
lastpos[Y_AXIS] = current_position[Y_AXIS];
lastpos[Z_AXIS] = current_position[Z_AXIS];
lastpos[E_AXIS] = current_position[E_AXIS];
memcpy(lastpos, current_position, sizeof(lastpos));
// Retract E
current_position[E_AXIS] += e_shift;