Skip to content

Commit 3ef192e

Browse files
committed
🎨 Cosmetic cleanup 23-01
1 parent 5fea79f commit 3ef192e

File tree

3 files changed

+44
-48
lines changed

3 files changed

+44
-48
lines changed

Marlin/src/lcd/marlinui.cpp

+33-34
Original file line numberDiff line numberDiff line change
@@ -847,52 +847,51 @@ void MarlinUI::init() {
847847
if (processing) return; // Prevent re-entry from idle() calls
848848

849849
// Add a manual move to the queue?
850-
if (axis != NO_AXIS_ENUM && ELAPSED(millis(), start_time) && !planner.is_full()) {
850+
if (axis == NO_AXIS_ENUM || PENDING(millis(), start_time) || planner.is_full()) return;
851851

852-
const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S;
852+
const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S;
853853

854-
#if IS_KINEMATIC
854+
#if IS_KINEMATIC
855855

856-
#if HAS_MULTI_EXTRUDER
857-
REMEMBER(ae, active_extruder);
858-
#if MULTI_E_MANUAL
859-
if (axis == E_AXIS) active_extruder = e_index;
860-
#endif
856+
#if HAS_MULTI_EXTRUDER
857+
REMEMBER(ae, active_extruder);
858+
#if MULTI_E_MANUAL
859+
if (axis == E_AXIS) active_extruder = e_index;
861860
#endif
861+
#endif
862862

863-
// Apply a linear offset to a single axis
864-
if (axis == ALL_AXES_ENUM)
865-
destination = all_axes_destination;
866-
else if (axis <= LOGICAL_AXES) {
867-
destination = current_position;
868-
destination[axis] += offset;
869-
}
863+
// Apply a linear offset to a single axis
864+
if (axis == ALL_AXES_ENUM)
865+
destination = all_axes_destination;
866+
else if (axis <= LOGICAL_AXES) {
867+
destination = current_position;
868+
destination[axis] += offset;
869+
}
870870

871-
// Reset for the next move
872-
offset = 0;
873-
axis = NO_AXIS_ENUM;
871+
// Reset for the next move
872+
offset = 0;
873+
axis = NO_AXIS_ENUM;
874874

875-
// DELTA and SCARA machines use segmented moves, which could fill the planner during the call to
876-
// move_to_destination. This will cause idle() to be called, which can then call this function while the
877-
// previous invocation is being blocked. Modifications to offset shouldn't be made while
878-
// processing is true or the planner will get out of sync.
879-
processing = true;
880-
prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination
881-
processing = false;
875+
// DELTA and SCARA machines use segmented moves, which could fill the planner during the call to
876+
// move_to_destination. This will cause idle() to be called, which can then call this function while the
877+
// previous invocation is being blocked. Modifications to offset shouldn't be made while
878+
// processing is true or the planner will get out of sync.
879+
processing = true;
880+
prepare_internal_move_to_destination(fr_mm_s); // will set current_position from destination
881+
processing = false;
882882

883-
#else
883+
#else
884884

885-
// For Cartesian / Core motion simply move to the current_position
886-
planner.buffer_line(current_position, fr_mm_s,
887-
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
888-
);
885+
// For Cartesian / Core motion simply move to the current_position
886+
planner.buffer_line(current_position, fr_mm_s,
887+
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
888+
);
889889

890-
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", C(AXIS_CHAR(axis)), " at FR ", fr_mm_s);
890+
//SERIAL_ECHOLNPGM("Add planner.move with Axis ", C(AXIS_CHAR(axis)), " at FR ", fr_mm_s);
891891

892-
axis = NO_AXIS_ENUM;
892+
axis = NO_AXIS_ENUM;
893893

894-
#endif
895-
}
894+
#endif
896895
}
897896

898897
//

Marlin/src/module/motion.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1318,8 +1318,9 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool
13181318
float cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, cartes_move));
13191319

13201320
// If the move is very short, check the E move distance
1321-
// No E move either? Game over.
13221321
TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e));
1322+
1323+
// No E move either? Game over.
13231324
if (UNEAR_ZERO(cartesian_mm)) return;
13241325

13251326
// The length divided by the segment size

Marlin/src/module/stepper.cpp

+9-13
Original file line numberDiff line numberDiff line change
@@ -2597,20 +2597,16 @@ hal_timer_t Stepper::block_phase_isr() {
25972597

25982598
AxisBits didmove;
25992599
NUM_AXIS_CODE(
2600-
if (X_MOVE_TEST) didmove.a = true,
2601-
if (Y_MOVE_TEST) didmove.b = true,
2602-
if (Z_MOVE_TEST) didmove.c = true,
2603-
if (current_block->steps.i) didmove.i = true,
2604-
if (current_block->steps.j) didmove.j = true,
2605-
if (current_block->steps.k) didmove.k = true,
2606-
if (current_block->steps.u) didmove.u = true,
2607-
if (current_block->steps.v) didmove.v = true,
2608-
if (current_block->steps.w) didmove.w = true
2600+
if (X_MOVE_TEST) didmove.a = true,
2601+
if (Y_MOVE_TEST) didmove.b = true,
2602+
if (Z_MOVE_TEST) didmove.c = true,
2603+
if (!!current_block->steps.i) didmove.i = true,
2604+
if (!!current_block->steps.j) didmove.j = true,
2605+
if (!!current_block->steps.k) didmove.k = true,
2606+
if (!!current_block->steps.u) didmove.u = true,
2607+
if (!!current_block->steps.v) didmove.v = true,
2608+
if (!!current_block->steps.w) didmove.w = true
26092609
);
2610-
//if (current_block->steps.e) didmove.e = true;
2611-
//if (current_block->steps.a) didmove.x = true;
2612-
//if (current_block->steps.b) didmove.y = true;
2613-
//if (current_block->steps.c) didmove.z = true;
26142610
axis_did_move = didmove;
26152611

26162612
// No acceleration / deceleration time elapsed so far

0 commit comments

Comments
 (0)