|
@@ -350,7 +350,7 @@
|
350
|
350
|
|| isnan(ubl.z_values[0][0]))
|
351
|
351
|
#endif
|
352
|
352
|
|
353
|
|
-#if ENABLED(NEOPIXEL_LED)
|
|
353
|
+#if ENABLED(NEOPIXEL_LED)
|
354
|
354
|
#if NEOPIXEL_TYPE == NEO_RGB || NEOPIXEL_TYPE == NEO_RBG || NEOPIXEL_TYPE == NEO_GRB || NEOPIXEL_TYPE == NEO_GBR || NEOPIXEL_TYPE == NEO_BRG || NEOPIXEL_TYPE == NEO_BGR
|
355
|
355
|
#define NEO_WHITE 255, 255, 255
|
356
|
356
|
#else
|
|
@@ -379,7 +379,7 @@ float current_position[XYZE] = { 0.0 };
|
379
|
379
|
/**
|
380
|
380
|
* Cartesian Destination
|
381
|
381
|
* A temporary position, usually applied to 'current_position'.
|
382
|
|
- * Set with 'gcode_get_destination' or 'set_destination_to_current'.
|
|
382
|
+ * Set with 'gcode_get_destination' or 'set_destination_from_current'.
|
383
|
383
|
* 'line_to_destination' sets 'current_position' to 'destination'.
|
384
|
384
|
*/
|
385
|
385
|
float destination[XYZE] = { 0.0 };
|
|
@@ -1633,8 +1633,8 @@ inline void line_to_destination(const float fr_mm_s) {
|
1633
|
1633
|
}
|
1634
|
1634
|
inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
|
1635
|
1635
|
|
1636
|
|
-inline void set_current_to_destination() { COPY(current_position, destination); }
|
1637
|
|
-inline void set_destination_to_current() { COPY(destination, current_position); }
|
|
1636
|
+inline void set_current_from_destination() { COPY(current_position, destination); }
|
|
1637
|
+inline void set_destination_from_current() { COPY(destination, current_position); }
|
1638
|
1638
|
|
1639
|
1639
|
#if IS_KINEMATIC
|
1640
|
1640
|
/**
|
|
@@ -1660,7 +1660,7 @@ inline void set_destination_to_current() { COPY(destination, current_position);
|
1660
|
1660
|
planner.buffer_line_kinematic(destination, MMS_SCALED(fr_mm_s ? fr_mm_s : feedrate_mm_s), active_extruder);
|
1661
|
1661
|
#endif
|
1662
|
1662
|
|
1663
|
|
- set_current_to_destination();
|
|
1663
|
+ set_current_from_destination();
|
1664
|
1664
|
}
|
1665
|
1665
|
#endif // IS_KINEMATIC
|
1666
|
1666
|
|
|
@@ -1681,10 +1681,10 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1681
|
1681
|
|
1682
|
1682
|
feedrate_mm_s = fr_mm_s ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
|
1683
|
1683
|
|
1684
|
|
- set_destination_to_current(); // sync destination at the start
|
|
1684
|
+ set_destination_from_current(); // sync destination at the start
|
1685
|
1685
|
|
1686
|
1686
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1687
|
|
- if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_to_current", destination);
|
|
1687
|
+ if (DEBUGGING(LEVELING)) DEBUG_POS("set_destination_from_current", destination);
|
1688
|
1688
|
#endif
|
1689
|
1689
|
|
1690
|
1690
|
// when in the danger zone
|
|
@@ -1693,7 +1693,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1693
|
1693
|
destination[X_AXIS] = lx; // move directly (uninterpolated)
|
1694
|
1694
|
destination[Y_AXIS] = ly;
|
1695
|
1695
|
destination[Z_AXIS] = lz;
|
1696
|
|
- prepare_uninterpolated_move_to_destination(); // set_current_to_destination
|
|
1696
|
+ prepare_uninterpolated_move_to_destination(); // set_current_from_destination
|
1697
|
1697
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1698
|
1698
|
if (DEBUGGING(LEVELING)) DEBUG_POS("danger zone move", current_position);
|
1699
|
1699
|
#endif
|
|
@@ -1701,7 +1701,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1701
|
1701
|
}
|
1702
|
1702
|
else {
|
1703
|
1703
|
destination[Z_AXIS] = delta_clip_start_height;
|
1704
|
|
- prepare_uninterpolated_move_to_destination(); // set_current_to_destination
|
|
1704
|
+ prepare_uninterpolated_move_to_destination(); // set_current_from_destination
|
1705
|
1705
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1706
|
1706
|
if (DEBUGGING(LEVELING)) DEBUG_POS("zone border move", current_position);
|
1707
|
1707
|
#endif
|
|
@@ -1710,7 +1710,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1710
|
1710
|
|
1711
|
1711
|
if (lz > current_position[Z_AXIS]) { // raising?
|
1712
|
1712
|
destination[Z_AXIS] = lz;
|
1713
|
|
- prepare_uninterpolated_move_to_destination(); // set_current_to_destination
|
|
1713
|
+ prepare_uninterpolated_move_to_destination(); // set_current_from_destination
|
1714
|
1714
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1715
|
1715
|
if (DEBUGGING(LEVELING)) DEBUG_POS("z raise move", current_position);
|
1716
|
1716
|
#endif
|
|
@@ -1718,14 +1718,14 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1718
|
1718
|
|
1719
|
1719
|
destination[X_AXIS] = lx;
|
1720
|
1720
|
destination[Y_AXIS] = ly;
|
1721
|
|
- prepare_move_to_destination(); // set_current_to_destination
|
|
1721
|
+ prepare_move_to_destination(); // set_current_from_destination
|
1722
|
1722
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1723
|
1723
|
if (DEBUGGING(LEVELING)) DEBUG_POS("xy move", current_position);
|
1724
|
1724
|
#endif
|
1725
|
1725
|
|
1726
|
1726
|
if (lz < current_position[Z_AXIS]) { // lowering?
|
1727
|
1727
|
destination[Z_AXIS] = lz;
|
1728
|
|
- prepare_uninterpolated_move_to_destination(); // set_current_to_destination
|
|
1728
|
+ prepare_uninterpolated_move_to_destination(); // set_current_from_destination
|
1729
|
1729
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
1730
|
1730
|
if (DEBUGGING(LEVELING)) DEBUG_POS("z lower move", current_position);
|
1731
|
1731
|
#endif
|
|
@@ -1735,7 +1735,7 @@ void do_blocking_move_to(const float &lx, const float &ly, const float &lz, cons
|
1735
|
1735
|
|
1736
|
1736
|
if (!position_is_reachable_xy(lx, ly)) return;
|
1737
|
1737
|
|
1738
|
|
- set_destination_to_current();
|
|
1738
|
+ set_destination_from_current();
|
1739
|
1739
|
|
1740
|
1740
|
// If Z needs to raise, do it before moving XY
|
1741
|
1741
|
if (destination[Z_AXIS] < lz) {
|
|
@@ -3196,7 +3196,7 @@ static void homeaxis(const AxisEnum axis) {
|
3196
|
3196
|
flow_percentage[active_extruder] = 100;
|
3197
|
3197
|
|
3198
|
3198
|
// The current position will be the destination for E and Z moves
|
3199
|
|
- set_destination_to_current();
|
|
3199
|
+ set_destination_from_current();
|
3200
|
3200
|
|
3201
|
3201
|
stepper.synchronize(); // Wait for all moves to finish
|
3202
|
3202
|
|
|
@@ -3996,7 +3996,7 @@ inline void gcode_G28(const bool always_home_all) {
|
3996
|
3996
|
homeZ = always_home_all || parser.seen('Z'),
|
3997
|
3997
|
home_all = (!homeX && !homeY && !homeZ) || (homeX && homeY && homeZ);
|
3998
|
3998
|
|
3999
|
|
- set_destination_to_current();
|
|
3999
|
+ set_destination_from_current();
|
4000
|
4000
|
|
4001
|
4001
|
#if Z_HOME_DIR > 0 // If homing away from BED do Z first
|
4002
|
4002
|
|
|
@@ -4204,7 +4204,7 @@ void home_all_axes() { gcode_G28(true); }
|
4204
|
4204
|
set_bed_leveling_enabled(true);
|
4205
|
4205
|
#if ENABLED(MESH_G28_REST_ORIGIN)
|
4206
|
4206
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
|
4207
|
|
- set_destination_to_current();
|
|
4207
|
+ set_destination_from_current();
|
4208
|
4208
|
line_to_destination(homing_feedrate(Z_AXIS));
|
4209
|
4209
|
stepper.synchronize();
|
4210
|
4210
|
#endif
|
|
@@ -5818,7 +5818,7 @@ void home_all_axes() { gcode_G28(true); }
|
5818
|
5818
|
|
5819
|
5819
|
#if ENABLED(PROBE_DOUBLE_TOUCH)
|
5820
|
5820
|
// Move away by the retract distance
|
5821
|
|
- set_destination_to_current();
|
|
5821
|
+ set_destination_from_current();
|
5822
|
5822
|
LOOP_XYZ(i) destination[i] += retract_mm[i];
|
5823
|
5823
|
endstops.enable(false);
|
5824
|
5824
|
prepare_move_to_destination();
|
|
@@ -5906,7 +5906,7 @@ void home_all_axes() { gcode_G28(true); }
|
5906
|
5906
|
#define _GET_MESH_Y(J) mbl.index_to_ypos[J]
|
5907
|
5907
|
#endif
|
5908
|
5908
|
|
5909
|
|
- set_destination_to_current();
|
|
5909
|
+ set_destination_from_current();
|
5910
|
5910
|
if (hasI) destination[X_AXIS] = LOGICAL_X_POSITION(_GET_MESH_X(ix));
|
5911
|
5911
|
if (hasJ) destination[Y_AXIS] = LOGICAL_Y_POSITION(_GET_MESH_Y(iy));
|
5912
|
5912
|
if (parser.boolval('P')) {
|
|
@@ -6249,7 +6249,7 @@ inline void gcode_M17() {
|
6249
|
6249
|
|
6250
|
6250
|
if (retract) {
|
6251
|
6251
|
// Initial retract before move to filament change position
|
6252
|
|
- set_destination_to_current();
|
|
6252
|
+ set_destination_from_current();
|
6253
|
6253
|
destination[E_AXIS] += retract;
|
6254
|
6254
|
RUNPLAN(PAUSE_PARK_RETRACT_FEEDRATE);
|
6255
|
6255
|
stepper.synchronize();
|
|
@@ -6271,7 +6271,7 @@ inline void gcode_M17() {
|
6271
|
6271
|
}
|
6272
|
6272
|
|
6273
|
6273
|
// Unload filament
|
6274
|
|
- set_destination_to_current();
|
|
6274
|
+ set_destination_from_current();
|
6275
|
6275
|
destination[E_AXIS] += unload_length;
|
6276
|
6276
|
RUNPLAN(FILAMENT_CHANGE_UNLOAD_FEEDRATE);
|
6277
|
6277
|
stepper.synchronize();
|
|
@@ -6375,7 +6375,7 @@ inline void gcode_M17() {
|
6375
|
6375
|
filament_change_beep(max_beep_count, true);
|
6376
|
6376
|
#endif
|
6377
|
6377
|
|
6378
|
|
- set_destination_to_current();
|
|
6378
|
+ set_destination_from_current();
|
6379
|
6379
|
|
6380
|
6380
|
if (load_length != 0) {
|
6381
|
6381
|
#if ENABLED(ULTIPANEL)
|
|
@@ -10476,7 +10476,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
10476
|
10476
|
}
|
10477
|
10477
|
|
10478
|
10478
|
// Save current position to destination, for use later
|
10479
|
|
- set_destination_to_current();
|
|
10479
|
+ set_destination_from_current();
|
10480
|
10480
|
|
10481
|
10481
|
#if ENABLED(DUAL_X_CARRIAGE)
|
10482
|
10482
|
|
|
@@ -12240,7 +12240,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12240
|
12240
|
if (cx1 == cx2 && cy1 == cy2) {
|
12241
|
12241
|
// Start and end on same mesh square
|
12242
|
12242
|
line_to_destination(fr_mm_s);
|
12243
|
|
- set_current_to_destination();
|
|
12243
|
+ set_current_from_destination();
|
12244
|
12244
|
return;
|
12245
|
12245
|
}
|
12246
|
12246
|
|
|
@@ -12267,7 +12267,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12267
|
12267
|
else {
|
12268
|
12268
|
// Already split on a border
|
12269
|
12269
|
line_to_destination(fr_mm_s);
|
12270
|
|
- set_current_to_destination();
|
|
12270
|
+ set_current_from_destination();
|
12271
|
12271
|
return;
|
12272
|
12272
|
}
|
12273
|
12273
|
|
|
@@ -12303,7 +12303,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12303
|
12303
|
if (cx1 == cx2 && cy1 == cy2) {
|
12304
|
12304
|
// Start and end on same mesh square
|
12305
|
12305
|
line_to_destination(fr_mm_s);
|
12306
|
|
- set_current_to_destination();
|
|
12306
|
+ set_current_from_destination();
|
12307
|
12307
|
return;
|
12308
|
12308
|
}
|
12309
|
12309
|
|
|
@@ -12330,7 +12330,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12330
|
12330
|
else {
|
12331
|
12331
|
// Already split on a border
|
12332
|
12332
|
line_to_destination(fr_mm_s);
|
12333
|
|
- set_current_to_destination();
|
|
12333
|
+ set_current_from_destination();
|
12334
|
12334
|
return;
|
12335
|
12335
|
}
|
12336
|
12336
|
|
|
@@ -12521,7 +12521,7 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
|
12521
|
12521
|
// Skip it, but keep track of the current position
|
12522
|
12522
|
// (so it can be used as the start of the next non-travel move)
|
12523
|
12523
|
if (delayed_move_time != 0xFFFFFFFFUL) {
|
12524
|
|
- set_current_to_destination();
|
|
12524
|
+ set_current_from_destination();
|
12525
|
12525
|
NOLESS(raised_parked_position[Z_AXIS], destination[Z_AXIS]);
|
12526
|
12526
|
delayed_move_time = millis();
|
12527
|
12527
|
return true;
|
|
@@ -12627,7 +12627,7 @@ void prepare_move_to_destination() {
|
12627
|
12627
|
#endif
|
12628
|
12628
|
) return;
|
12629
|
12629
|
|
12630
|
|
- set_current_to_destination();
|
|
12630
|
+ set_current_from_destination();
|
12631
|
12631
|
}
|
12632
|
12632
|
|
12633
|
12633
|
#if ENABLED(ARC_SUPPORT)
|
|
@@ -12784,7 +12784,7 @@ void prepare_move_to_destination() {
|
12784
|
12784
|
// As far as the parser is concerned, the position is now == target. In reality the
|
12785
|
12785
|
// motion control system might still be processing the action and the real tool position
|
12786
|
12786
|
// in any intermediate location.
|
12787
|
|
- set_current_to_destination();
|
|
12787
|
+ set_current_from_destination();
|
12788
|
12788
|
} // plan_arc
|
12789
|
12789
|
|
12790
|
12790
|
#endif // ARC_SUPPORT
|
|
@@ -12797,7 +12797,7 @@ void prepare_move_to_destination() {
|
12797
|
12797
|
// As far as the parser is concerned, the position is now == destination. In reality the
|
12798
|
12798
|
// motion control system might still be processing the action and the real tool position
|
12799
|
12799
|
// in any intermediate location.
|
12800
|
|
- set_current_to_destination();
|
|
12800
|
+ set_current_from_destination();
|
12801
|
12801
|
}
|
12802
|
12802
|
|
12803
|
12803
|
#endif // BEZIER_CURVE_SUPPORT
|
|
@@ -13321,7 +13321,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
13321
|
13321
|
if (delayed_move_time && ELAPSED(ms, delayed_move_time + 1000UL) && IsRunning()) {
|
13322
|
13322
|
// travel moves have been received so enact them
|
13323
|
13323
|
delayed_move_time = 0xFFFFFFFFUL; // force moves to be done
|
13324
|
|
- set_destination_to_current();
|
|
13324
|
+ set_destination_from_current();
|
13325
|
13325
|
prepare_move_to_destination();
|
13326
|
13326
|
}
|
13327
|
13327
|
#endif
|