Skip to content

Commit 38ac715

Browse files
committed
fixup
1 parent c9055e1 commit 38ac715

File tree

8 files changed

+26
-26
lines changed

8 files changed

+26
-26
lines changed

Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
* case - crossing only one X or Y line - after details are worked out to reduce computation.
106106
*/
107107

108-
const xy_float_t dist = xy_float_t(end) - xy_float_t(start);
108+
const xy_float_t dist = end - start;
109109
const xy_bool_t neg { dist.x < 0, dist.y < 0 };
110110
const xy_uint8_t ineg { uint8_t(neg.x), uint8_t(neg.y) };
111111
const xy_float_t sign { neg.x ? -1.0f : 1.0f, neg.y ? -1.0f : 1.0f };
@@ -362,32 +362,32 @@
362362
planner.buffer_line(destination, scaled_fr_mm_s);
363363
return false; // caller will update current_position
364364
}
365-
if (!parser.process_motion_gcode)
366-
parser.cartesian_mm = get_move_distance(total OPTARG(HAS_ROTATIONAL_AXES, parser.cartes_move));
365+
bool cartes_move = true;
366+
float cartesian_mm = get_move_distance(total OPTARG(HAS_ROTATIONAL_AXES, cartes_move));
367367

368368
// If the move is very short, check the E move distance
369-
TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(parser.cartesian_mm)) parser.cartesian_mm = ABS(total.e));
369+
TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(total.e));
370370

371371
// No E move either? Game over.
372-
if (UNEAR_ZERO(parser.cartesian_mm)) return true;
372+
if (UNEAR_ZERO(cartesian_mm)) return true;
373373

374374
#if IS_KINEMATIC
375375
// Minimum number of seconds to move the given distance
376-
const float seconds = parser.cartesian_mm / scaled_fr_mm_s;
376+
const float seconds = cartesian_mm / scaled_fr_mm_s;
377377

378378
uint16_t segments = LROUND(segments_per_second * seconds), // Preferred number of segments for distance @ feedrate
379-
seglimit = LROUND(parser.cartesian_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length
379+
seglimit = LROUND(cartesian_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Number of segments at minimum segment length
380380

381381
NOMORE(segments, seglimit); // Limit to minimum segment length (fewer segments)
382382
#else
383-
uint16_t segments = LROUND(parser.cartesian_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length
383+
uint16_t segments = LROUND(cartesian_mm * RECIPROCAL(SEGMENT_MIN_LENGTH)); // Cartesian fixed segment length
384384
#endif
385385

386386
NOLESS(segments, 1U); // Must have at least one segment
387387
const float inv_segments = 1.0f / segments; // Reciprocal to save calculation
388388

389389
// Add hints to help optimize the move
390-
PlannerHints hints(parser.cartesian_mm * inv_segments); // Length of each segment
390+
PlannerHints hints(cartesian_mm * inv_segments); // Length of each segment
391391
#if ENABLED(FEEDRATE_SCALING)
392392
hints.inv_duration = scaled_fr_mm_s / hints.millimeters;
393393
#endif

Marlin/src/gcode/bedlevel/G42.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void GcodeSuite::G42() {
5454
return;
5555
}
5656

57-
TERN_(FEEDRATE_MODE_SUPPORT, parser.process_motion_gcode = true);
57+
TERN_(FEEDRATE_MODE_SUPPORT, parser.linear_motion_gcode = true);
5858

5959
// Move to current_position, as modified by I, J, P parameters
6060
destination = current_position;
@@ -79,7 +79,7 @@ void GcodeSuite::G42() {
7979
prepare_internal_move_to_destination(fr_mm_s);
8080
#endif
8181

82-
TERN_(FEEDRATE_MODE_SUPPORT, parser.process_motion_gcode = false);
82+
TERN_(FEEDRATE_MODE_SUPPORT, parser.linear_motion_gcode = false);
8383
}
8484

8585
#endif // HAS_MESH

Marlin/src/gcode/motion/G0_G1.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,30 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
5757
feedRate_t old_feedrate;
5858
#if ENABLED(VARIABLE_G0_FEEDRATE)
5959
#if ENABLED(FEEDRATE_MODE_SUPPORT)
60-
parser.process_motion_gcode = true;
60+
parser.linear_motion_gcode = true;
6161
#endif
6262
if (fast_move) {
6363
old_feedrate = feedrate_mm_s; // Back up the (old) motion mode feedrate
6464
feedrate_mm_s = fast_move_feedrate; // Get G0 feedrate from last usage
6565
}
6666
#elif ENABLED(FEEDRATE_MODE_SUPPORT)
6767
if (fast_move) {
68-
parser.process_motion_gcode = false;
68+
parser.linear_motion_gcode = false;
6969
}
7070
else {
71-
parser.process_motion_gcode = true;
71+
parser.linear_motion_gcode = true;
7272
}
7373
#endif
7474
#elif ENABLED(FEEDRATE_MODE_SUPPORT)
75-
parser.process_motion_gcode = true;
75+
parser.linear_motion_gcode = true;
7676
#endif
7777

7878
get_destination_from_command(); // Get X Y [Z[I[J[K]]]] [E] F (and set cutter power)
7979

8080
#ifdef G0_FEEDRATE
8181
if (fast_move) {
8282
#if ENABLED(FEEDRATE_MODE_SUPPORT)
83-
parser.process_motion_gcode = false;
83+
parser.linear_motion_gcode = false;
8484
#endif
8585
#if ENABLED(VARIABLE_G0_FEEDRATE)
8686
fast_move_feedrate = feedrate_mm_s; // Save feedrate for the next G0
@@ -123,7 +123,7 @@ void GcodeSuite::G0_G1(TERN_(HAS_FAST_MOVES, const bool fast_move/*=false*/)) {
123123
#endif
124124

125125
#if ENABLED(FEEDRATE_MODE_SUPPORT)
126-
parser.process_motion_gcode = false;
126+
parser.linear_motion_gcode = false;
127127
#endif
128128

129129
#if ENABLED(NANODLP_Z_SYNC)

Marlin/src/gcode/motion/G2_G3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ void GcodeSuite::G2_G3(const bool clockwise) {
429429

430430
TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_RUNNING));
431431
#if HAS_ROTATIONAL_AXES || IS_KINEMATIC || HAS_LEVELING || ENABLED(FEEDRATE_MODE_SUPPORT)
432-
parser.process_motion_gcode = false;
432+
parser.linear_motion_gcode = false;
433433
#endif
434434

435435
#if ENABLED(SF_ARC_FIX)

Marlin/src/gcode/parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool GCodeParser::volumetric_enabled;
3838
#endif
3939

4040
#if HAS_ROTATIONAL_AXES || IS_KINEMATIC || HAS_LEVELING || ENABLED(FEEDRATE_MODE_SUPPORT)
41-
bool GCodeParser::process_motion_gcode;
41+
bool GCodeParser::linear_motion_gcode;
4242
float GCodeParser::cartesian_mm;
4343
#if ENABLED(FEEDRATE_MODE_SUPPORT)
4444
bool GCodeParser::inverse_time_enabled;

Marlin/src/gcode/parser.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class GCodeParser {
7878

7979
#if HAS_ROTATIONAL_AXES || IS_KINEMATIC || HAS_LEVELING || ENABLED(FEEDRATE_MODE_SUPPORT)
8080
static float cartesian_mm;
81-
static bool process_motion_gcode;
81+
static bool linear_motion_gcode;
8282
#if ENABLED(FEEDRATE_MODE_SUPPORT)
8383
static bool inverse_time_enabled;
8484
#endif
@@ -428,12 +428,12 @@ class GCodeParser {
428428

429429
static feedRate_t value_feedrate() {
430430
#if HAS_ROTATIONAL_AXES || ENABLED(FEEDRATE_MODE_SUPPORT)
431-
float fr = ((TERN0(FEEDRATE_MODE_SUPPORT, inverse_time_enabled && process_motion_gcode)) || TERN0(HAS_ROTATIONAL_AXES, (!cartes_move))) ? value_float() : value_linear_units();
431+
float fr = ((TERN0(FEEDRATE_MODE_SUPPORT, inverse_time_enabled && linear_motion_gcode)) || TERN0(HAS_ROTATIONAL_AXES, (!cartes_move))) ? value_float() : value_linear_units();
432432
#if ENABLED(FEEDRATE_MODE_SUPPORT)
433-
if (inverse_time_enabled && process_motion_gcode)
433+
if (inverse_time_enabled && linear_motion_gcode)
434434
fr *= cartesian_mm;
435435
#endif
436-
return fr
436+
return fr;
437437
#else
438438
return value_linear_units();
439439
#endif

Marlin/src/module/motion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,7 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool
15791579

15801580
// Fail if attempting move outside printable radius
15811581
if (!position_is_reachable(destination)) return true;
1582-
if (!parser.process_motion_gcode)
1582+
if (!parser.linear_motion_gcode)
15831583
parser.cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, parser.cartes_move));
15841584

15851585
// If the move is very short, check the E move distance
@@ -1662,7 +1662,7 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool
16621662
}
16631663

16641664
// Get the move distance
1665-
if (parser.process_motion_gcode)
1665+
if (parser.linear_motion_gcode)
16661666
parser.cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, parser.cartes_move));
16671667

16681668
// If the move is very short, check the E move distance

Marlin/src/module/planner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2982,7 +2982,7 @@ bool Planner::buffer_line(const xyze_pos_t &cart, const feedRate_t fr_mm_s
29822982

29832983
PlannerHints ph = hints;
29842984
if (!hints.millimeters)
2985-
ph.millimeters = get_move_distance(xyze_pos_t(cart_dist_mm) OPTARG(HAS_ROTATIONAL_AXES, parser.cartesian_move));
2985+
ph.millimeters = get_move_distance(xyze_pos_t(cart_dist_mm) OPTARG(HAS_ROTATIONAL_AXES, parser.cartes_move));
29862986

29872987
#if DISABLED(FEEDRATE_SCALING)
29882988

0 commit comments

Comments
 (0)