Skip to content

Commit

Permalink
merge followup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 10, 2022
1 parent 768ac15 commit e5c295f
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 57 deletions.
34 changes: 19 additions & 15 deletions Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,13 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
void line_to_current_position(const_feedRate_t fr_mm_s/*=feedrate_mm_s*/
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s/*=feedrate_deg_s*/)
) {
planner.buffer_line(current_position
OPTARG(HAS_ROTATIONAL_AXES, fr_deg_s)
, fr_mm_s
);
#if HAS_ROTATIONAL_AXES
PlannerHints hints;
hints.fr_deg_s = fr_deg_s;
planner.buffer_line(current_position, fr_mm_s, active_extruder, hints);
#else
planner.buffer_line(current_position, fr_mm_s);
#endif
}

#if HAS_EXTRUDERS
Expand Down Expand Up @@ -487,7 +490,8 @@ void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/
*/
void do_blocking_move_to(NUM_AXIS_ARGS(const float)
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s/*=0.0*/)
, const_feedRate_t fr_mm_s/*=0.0f*/) {
, const_feedRate_t fr_mm_s/*=0.0f*/
) {
DEBUG_SECTION(log_move, "do_blocking_move_to", DEBUGGING(LEVELING));
if (DEBUGGING(LEVELING)) DEBUG_XYZ("> ", NUM_AXIS_ARGS());

Expand Down Expand Up @@ -558,15 +562,15 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float)
#else

#if HAS_Z_AXIS // If Z needs to raise, do it before moving XY
if (current_position.z < z) {
current_position.z = z;
if (current_position.z < z) {
current_position.z = z;
line_to_current_position(z_feedrate
OPTARG(HAS_ROTATIONAL_AXES, z_feedrate)
);
OPTARG(HAS_ROTATIONAL_AXES, z_feedrate)
);
}
#endif

current_position.set(x, y);
current_position.set(x, y);
line_to_current_position(xy_feedrate
OPTARG(HAS_ROTATIONAL_AXES, xy_feedrate)
);
Expand All @@ -578,13 +582,13 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float)
);
#endif
#if HAS_J_AXIS
current_position.j = j;
current_position.j = j;
line_to_current_position(j_feedrate
OPTARG(HAS_ROTATIONAL_AXES, j_feedrate)
OPTARG(HAS_ROTATIONAL_AXES, j_feedrate)
);
#endif
#if HAS_K_AXIS
current_position.k = k;
current_position.k = k;
line_to_current_position(k_feedrate
OPTARG(HAS_ROTATIONAL_AXES, k_feedrate)
);
Expand All @@ -610,11 +614,11 @@ void do_blocking_move_to(NUM_AXIS_ARGS(const float)

#if HAS_Z_AXIS
// If Z needs to lower, do it after moving XY
if (current_position.z > z) {
if (current_position.z > z) {
current_position.z = z;
line_to_current_position(z_feedrate
OPTARG(HAS_ROTATIONAL_AXES, z_feedrate)
);
);
}
#endif

Expand Down
125 changes: 83 additions & 42 deletions Marlin/src/module/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ void sync_plan_position();
* Move the planner to the current position from wherever it last moved
* (or from wherever it has been told it is located).
*/
void line_to_current_position(const_feedRate_t fr_mm_s=feedrate_mm_s
void line_to_current_position(
const_feedRate_t fr_mm_s=feedrate_mm_s
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=feedrate_deg_s)
);

Expand All @@ -330,47 +331,56 @@ void line_to_current_position(const_feedRate_t fr_mm_s=feedrate_mm_s

void prepare_line_to_destination();

void _internal_move_to_destination(const_feedRate_t fr_mm_s=0.0f
void _internal_move_to_destination(
const_feedRate_t fr_mm_s=0.0f
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_mm_s=0.0f)
OPTARG(IS_KINEMATIC, const bool is_fast=false));
OPTARG(IS_KINEMATIC, const bool is_fast=false)
);

inline void prepare_internal_move_to_destination(
const_feedRate_t fr_mm_s=0.0f
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
) {
_internal_move_to_destination(fr_mm_s
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
);
) {
_internal_move_to_destination(fr_mm_s OPTARG(HAS_ROTATIONAL_AXES, fr_deg_s));
}

#if IS_KINEMATIC
void prepare_fast_move_to_destination(const_feedRate_t scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)));
void prepare_fast_move_to_destination(
const_feedRate_t scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s)
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
);

inline void prepare_internal_fast_move_to_destination(const_feedRate_t fr_mm_s=0.0f
inline void prepare_internal_fast_move_to_destination(
const_feedRate_t fr_mm_s=0.0f
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
) {
_internal_move_to_destination(fr_mm_s
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, true);
_internal_move_to_destination(fr_mm_s OPTARG(HAS_ROTATIONAL_AXES, fr_deg_s), true);
}
#endif

/**
* Blocking movement and shorthand functions
*/
void do_blocking_move_to(NUM_AXIS_ARGS(const float)
void do_blocking_move_to(
NUM_AXIS_ARGS(const float)
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to(const xy_pos_t &raw
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to(
const xy_pos_t &raw
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to(const xyz_pos_t &raw
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to(
const xyz_pos_t &raw
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to(const xyze_pos_t &raw
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to(
const xyze_pos_t &raw
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s=0.0f);
#if HAS_Y_AXIS
void do_blocking_move_to_y(const_float_t ry, const_feedRate_t fr_mm_s=0.0f);
Expand All @@ -379,46 +389,77 @@ void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s=0.0f);
#endif
#if HAS_I_AXIS
void do_blocking_move_to_i(const_float_t ri
void do_blocking_move_to_i(
const_float_t ri
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyz_i(const xyze_pos_t &raw, const_float_t i
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyz_i(
const xyze_pos_t &raw
, const_float_t i
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
#endif
#if HAS_J_AXIS
void do_blocking_move_to_j(const_float_t rj
void do_blocking_move_to_j(
const_float_t rj
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzi_j(const xyze_pos_t &raw, const_float_t j
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyzi_j(
const xyze_pos_t &raw
, const_float_t j
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
#endif
#if HAS_K_AXIS
void do_blocking_move_to_k(const_float_t rk
void do_blocking_move_to_k(
const_float_t rk
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzij_k(const xyze_pos_t &raw, const_float_t k
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyzij_k(
const xyze_pos_t &raw
, const_float_t k
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
#endif
#if HAS_U_AXIS
void do_blocking_move_to_u(const_float_t ru
void do_blocking_move_to_u(
const_float_t ru
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzijk_u(const xyze_pos_t &raw, const_float_t u, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyzijk_u(
const xyze_pos_t &raw
, const_float_t u
, const_feedRate_t fr_mm_s=0.0f
);
#endif
#if HAS_V_AXIS
void do_blocking_move_to_v(const_float_t rv
void do_blocking_move_to_v(
const_float_t rv
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const_feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzijku_v(const xyze_pos_t &raw, const_float_t v, const_feedRate_t fr_mm_s=0.0f);
, const_feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyzijku_v(
const xyze_pos_t &raw
, const_float_t v
, const_feedRate_t fr_mm_s=0.0f
);
#endif
#if HAS_W_AXIS
void do_blocking_move_to_w(const float rw
void do_blocking_move_to_w(
const_float_t rw
OPTARG(HAS_ROTATIONAL_AXES, const_feedRate_t fr_deg_s=0.0f)
, const feedRate_t fr_mm_s=0.0f);
void do_blocking_move_to_xyzijkuv_w(const xyze_pos_t &raw, const float w, const feedRate_t &fr_mm_s=0.0f);
, const feedRate_t fr_mm_s=0.0f
);
void do_blocking_move_to_xyzijkuv_w(
const xyze_pos_t &raw
, const_float_t w, const feedRate_t &fr_mm_s=0.0f);
#endif

#if HAS_Y_AXIS
Expand Down

0 comments on commit e5c295f

Please sign in to comment.