|
@@ -1567,8 +1567,8 @@ inline void line_to_destination(float fr_mm_s) {
|
1567
|
1567
|
}
|
1568
|
1568
|
inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
|
1569
|
1569
|
|
1570
|
|
-inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
|
1571
|
|
-inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
|
|
1570
|
+inline void set_current_to_destination() { COPY(current_position, destination); }
|
|
1571
|
+inline void set_destination_to_current() { COPY(destination, current_position); }
|
1572
|
1572
|
|
1573
|
1573
|
#if IS_KINEMATIC
|
1574
|
1574
|
/**
|
|
@@ -3583,7 +3583,7 @@ inline void gcode_G28() {
|
3583
|
3583
|
HOMEAXIS(X);
|
3584
|
3584
|
|
3585
|
3585
|
// Consider the active extruder to be parked
|
3586
|
|
- memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
3586
|
+ COPY(raised_parked_position, current_position);
|
3587
|
3587
|
delayed_move_time = 0;
|
3588
|
3588
|
active_extruder_parked = true;
|
3589
|
3589
|
|
|
@@ -4383,7 +4383,7 @@ inline void gcode_G28() {
|
4383
|
4383
|
#endif
|
4384
|
4384
|
|
4385
|
4385
|
float converted[XYZ];
|
4386
|
|
- memcpy(converted, current_position, sizeof(converted));
|
|
4386
|
+ COPY(converted, current_position);
|
4387
|
4387
|
|
4388
|
4388
|
planner.abl_enabled = true;
|
4389
|
4389
|
planner.unapply_leveling(converted); // use conversion machinery
|
|
@@ -4405,7 +4405,7 @@ inline void gcode_G28() {
|
4405
|
4405
|
}
|
4406
|
4406
|
|
4407
|
4407
|
// The rotated XY and corrected Z are now current_position
|
4408
|
|
- memcpy(current_position, converted, sizeof(converted));
|
|
4408
|
+ COPY(current_position, converted);
|
4409
|
4409
|
|
4410
|
4410
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
4411
|
4411
|
if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position);
|
|
@@ -7965,7 +7965,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
7965
|
7965
|
break;
|
7966
|
7966
|
case DXC_AUTO_PARK_MODE:
|
7967
|
7967
|
// record raised toolhead position for use by unpark
|
7968
|
|
- memcpy(raised_parked_position, current_position, sizeof(raised_parked_position));
|
|
7968
|
+ COPY(raised_parked_position, current_position);
|
7969
|
7969
|
raised_parked_position[Z_AXIS] += TOOLCHANGE_UNPARK_ZLIFT;
|
7970
|
7970
|
#if ENABLED(max_software_endstops)
|
7971
|
7971
|
NOMORE(raised_parked_position[Z_AXIS], soft_endstop_max[Z_AXIS]);
|
|
@@ -9332,7 +9332,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9332
|
9332
|
planner.unapply_leveling(cartes);
|
9333
|
9333
|
#endif
|
9334
|
9334
|
if (axis == ALL_AXES)
|
9335
|
|
- memcpy(current_position, cartes, sizeof(cartes));
|
|
9335
|
+ COPY(current_position, cartes);
|
9336
|
9336
|
else
|
9337
|
9337
|
current_position[axis] = cartes[axis];
|
9338
|
9338
|
}
|
|
@@ -9367,14 +9367,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9367
|
9367
|
// Split at the left/front border of the right/top square
|
9368
|
9368
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
9369
|
9369
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
9370
|
|
- memcpy(end, destination, sizeof(end));
|
|
9370
|
+ COPY(end, destination);
|
9371
|
9371
|
destination[X_AXIS] = LOGICAL_X_POSITION(mbl.get_probe_x(gcx));
|
9372
|
9372
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
9373
|
9373
|
destination[Y_AXIS] = MBL_SEGMENT_END(Y);
|
9374
|
9374
|
CBI(x_splits, gcx);
|
9375
|
9375
|
}
|
9376
|
9376
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
9377
|
|
- memcpy(end, destination, sizeof(end));
|
|
9377
|
+ COPY(end, destination);
|
9378
|
9378
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(mbl.get_probe_y(gcy));
|
9379
|
9379
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
9380
|
9380
|
destination[X_AXIS] = MBL_SEGMENT_END(X);
|
|
@@ -9394,7 +9394,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9394
|
9394
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
9395
|
9395
|
|
9396
|
9396
|
// Restore destination from stack
|
9397
|
|
- memcpy(destination, end, sizeof(end));
|
|
9397
|
+ COPY(destination, end);
|
9398
|
9398
|
mesh_line_to_destination(fr_mm_s, x_splits, y_splits);
|
9399
|
9399
|
}
|
9400
|
9400
|
|
|
@@ -9430,14 +9430,14 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9430
|
9430
|
// Split at the left/front border of the right/top square
|
9431
|
9431
|
int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
|
9432
|
9432
|
if (cx2 != cx1 && TEST(x_splits, gcx)) {
|
9433
|
|
- memcpy(end, destination, sizeof(end));
|
|
9433
|
+ COPY(end, destination);
|
9434
|
9434
|
destination[X_AXIS] = LOGICAL_X_POSITION(bilinear_start[X_AXIS] + ABL_BG_SPACING(X_AXIS) * gcx);
|
9435
|
9435
|
normalized_dist = (destination[X_AXIS] - current_position[X_AXIS]) / (end[X_AXIS] - current_position[X_AXIS]);
|
9436
|
9436
|
destination[Y_AXIS] = LINE_SEGMENT_END(Y);
|
9437
|
9437
|
CBI(x_splits, gcx);
|
9438
|
9438
|
}
|
9439
|
9439
|
else if (cy2 != cy1 && TEST(y_splits, gcy)) {
|
9440
|
|
- memcpy(end, destination, sizeof(end));
|
|
9440
|
+ COPY(end, destination);
|
9441
|
9441
|
destination[Y_AXIS] = LOGICAL_Y_POSITION(bilinear_start[Y_AXIS] + ABL_BG_SPACING(Y_AXIS) * gcy);
|
9442
|
9442
|
normalized_dist = (destination[Y_AXIS] - current_position[Y_AXIS]) / (end[Y_AXIS] - current_position[Y_AXIS]);
|
9443
|
9443
|
destination[X_AXIS] = LINE_SEGMENT_END(X);
|
|
@@ -9457,7 +9457,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9457
|
9457
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
9458
|
9458
|
|
9459
|
9459
|
// Restore destination from stack
|
9460
|
|
- memcpy(destination, end, sizeof(end));
|
|
9460
|
+ COPY(destination, end);
|
9461
|
9461
|
bilinear_line_to_destination(fr_mm_s, x_splits, y_splits);
|
9462
|
9462
|
}
|
9463
|
9463
|
|
|
@@ -9552,7 +9552,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
9552
|
9552
|
|
9553
|
9553
|
// Get the logical current position as starting point
|
9554
|
9554
|
float logical[XYZE];
|
9555
|
|
- memcpy(logical, current_position, sizeof(logical));
|
|
9555
|
+ COPY(logical, current_position);
|
9556
|
9556
|
|
9557
|
9557
|
#define DELTA_VAR logical
|
9558
|
9558
|
|
|
@@ -10527,7 +10527,7 @@ void setup() {
|
10527
|
10527
|
|
10528
|
10528
|
#if DISABLED(NO_WORKSPACE_OFFSETS)
|
10529
|
10529
|
// Initialize current position based on home_offset
|
10530
|
|
- memcpy(current_position, home_offset, sizeof(home_offset));
|
|
10530
|
+ COPY(current_position, home_offset);
|
10531
|
10531
|
#else
|
10532
|
10532
|
ZERO(current_position);
|
10533
|
10533
|
#endif
|