|
@@ -457,6 +457,14 @@
|
457
|
457
|
|
458
|
458
|
#if UBL_DELTA
|
459
|
459
|
|
|
460
|
+ // macro to inline copy exactly 4 floats, don't rely on sizeof operator
|
|
461
|
+ #define COPY_XYZE( target, source ) { \
|
|
462
|
+ target[X_AXIS] = source[X_AXIS]; \
|
|
463
|
+ target[Y_AXIS] = source[Y_AXIS]; \
|
|
464
|
+ target[Z_AXIS] = source[Z_AXIS]; \
|
|
465
|
+ target[E_AXIS] = source[E_AXIS]; \
|
|
466
|
+ }
|
|
467
|
+
|
460
|
468
|
#if IS_SCARA // scale the feed rate from mm/s to degrees/s
|
461
|
469
|
static float scara_feed_factor, scara_oldA, scara_oldB;
|
462
|
470
|
#endif
|
|
@@ -550,8 +558,8 @@
|
550
|
558
|
|
551
|
559
|
const float z_offset = ubl.state.active ? ubl.state.z_offset : 0.0;
|
552
|
560
|
|
553
|
|
- float seg_dest[XYZE]; // per-segment destination,
|
554
|
|
- COPY(seg_dest, current_position); // starting from current position
|
|
561
|
+ float seg_dest[XYZE]; // per-segment destination,
|
|
562
|
+ COPY_XYZE(seg_dest, current_position); // starting from current position
|
555
|
563
|
|
556
|
564
|
while (--segments) {
|
557
|
565
|
LOOP_XYZE(i) seg_dest[i] += segment_distance[i];
|
|
@@ -562,7 +570,7 @@
|
562
|
570
|
}
|
563
|
571
|
|
564
|
572
|
// Since repeated adding segment_distance accumulates small errors, final move to exact destination.
|
565
|
|
- COPY(seg_dest, ltarget);
|
|
573
|
+ COPY_XYZE(seg_dest, ltarget);
|
566
|
574
|
seg_dest[Z_AXIS] += z_offset;
|
567
|
575
|
ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
|
568
|
576
|
return false; // moved but did not set_current_to_destination();
|
|
@@ -645,7 +653,7 @@
|
645
|
653
|
z_cxcy += ubl.state.z_offset; // add fixed mesh offset from G29 Z
|
646
|
654
|
|
647
|
655
|
if (--segments == 0) { // if this is last segment, use ltarget for exact
|
648
|
|
- COPY(seg_dest, ltarget);
|
|
656
|
+ COPY_XYZE(seg_dest, ltarget);
|
649
|
657
|
seg_dest[Z_AXIS] += z_cxcy;
|
650
|
658
|
ubl_buffer_line_segment(seg_dest, feedrate, active_extruder);
|
651
|
659
|
return false; // did not set_current_to_destination()
|