Skip to content

Commit

Permalink
馃帹 Cosmetic cleanup 23-01
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jan 23, 2024
1 parent 5fea79f commit 3ef192e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 48 deletions.
67 changes: 33 additions & 34 deletions Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,52 +847,51 @@ void MarlinUI::init() {
if (processing) return; // Prevent re-entry from idle() calls

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

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

#if IS_KINEMATIC
#if IS_KINEMATIC

#if HAS_MULTI_EXTRUDER
REMEMBER(ae, active_extruder);
#if MULTI_E_MANUAL
if (axis == E_AXIS) active_extruder = e_index;
#endif
#if HAS_MULTI_EXTRUDER
REMEMBER(ae, active_extruder);
#if MULTI_E_MANUAL
if (axis == E_AXIS) active_extruder = e_index;
#endif
#endif

// Apply a linear offset to a single axis
if (axis == ALL_AXES_ENUM)
destination = all_axes_destination;
else if (axis <= LOGICAL_AXES) {
destination = current_position;
destination[axis] += offset;
}
// Apply a linear offset to a single axis
if (axis == ALL_AXES_ENUM)
destination = all_axes_destination;
else if (axis <= LOGICAL_AXES) {
destination = current_position;
destination[axis] += offset;
}

// Reset for the next move
offset = 0;
axis = NO_AXIS_ENUM;
// Reset for the next move
offset = 0;
axis = NO_AXIS_ENUM;

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

#else
#else

// For Cartesian / Core motion simply move to the current_position
planner.buffer_line(current_position, fr_mm_s,
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
);
// For Cartesian / Core motion simply move to the current_position
planner.buffer_line(current_position, fr_mm_s,
TERN_(MULTI_E_MANUAL, axis == E_AXIS ? e_index :) active_extruder
);

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

axis = NO_AXIS_ENUM;
axis = NO_AXIS_ENUM;

#endif
}
#endif
}

//
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,9 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool
float cartesian_mm = get_move_distance(diff OPTARG(HAS_ROTATIONAL_AXES, cartes_move));

// If the move is very short, check the E move distance
// No E move either? Game over.
TERN_(HAS_EXTRUDERS, if (UNEAR_ZERO(cartesian_mm)) cartesian_mm = ABS(diff.e));

// No E move either? Game over.
if (UNEAR_ZERO(cartesian_mm)) return;

// The length divided by the segment size
Expand Down
22 changes: 9 additions & 13 deletions Marlin/src/module/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2597,20 +2597,16 @@ hal_timer_t Stepper::block_phase_isr() {

AxisBits didmove;
NUM_AXIS_CODE(
if (X_MOVE_TEST) didmove.a = true,
if (Y_MOVE_TEST) didmove.b = true,
if (Z_MOVE_TEST) didmove.c = true,
if (current_block->steps.i) didmove.i = true,
if (current_block->steps.j) didmove.j = true,
if (current_block->steps.k) didmove.k = true,
if (current_block->steps.u) didmove.u = true,
if (current_block->steps.v) didmove.v = true,
if (current_block->steps.w) didmove.w = true
if (X_MOVE_TEST) didmove.a = true,
if (Y_MOVE_TEST) didmove.b = true,
if (Z_MOVE_TEST) didmove.c = true,
if (!!current_block->steps.i) didmove.i = true,
if (!!current_block->steps.j) didmove.j = true,
if (!!current_block->steps.k) didmove.k = true,
if (!!current_block->steps.u) didmove.u = true,
if (!!current_block->steps.v) didmove.v = true,
if (!!current_block->steps.w) didmove.w = true
);
//if (current_block->steps.e) didmove.e = true;
//if (current_block->steps.a) didmove.x = true;
//if (current_block->steps.b) didmove.y = true;
//if (current_block->steps.c) didmove.z = true;
axis_did_move = didmove;

// No acceleration / deceleration time elapsed so far
Expand Down

0 comments on commit 3ef192e

Please sign in to comment.