Browse Source

Add missing motion inline methods (#15433)

Timm 5 years ago
parent
commit
b198f321c8
2 changed files with 15 additions and 6 deletions
  1. 1
    1
      Marlin/src/feature/pause.cpp
  2. 14
    5
      Marlin/src/module/motion.h

+ 1
- 1
Marlin/src/feature/pause.cpp View File

655
   if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
655
   if (resume_position.e < 0) do_pause_e_move(resume_position.e, feedRate_t(PAUSE_PARK_RETRACT_FEEDRATE));
656
 
656
 
657
   // Move XY to starting position, then Z
657
   // Move XY to starting position, then Z
658
-  do_blocking_move_to_xy(xy_pos_t(resume_position), feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
658
+  do_blocking_move_to_xy(resume_position, feedRate_t(NOZZLE_PARK_XY_FEEDRATE));
659
 
659
 
660
   // Move Z_AXIS to saved position
660
   // Move Z_AXIS to saved position
661
   do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
661
   do_blocking_move_to_z(resume_position.z, feedRate_t(NOZZLE_PARK_Z_FEEDRATE));

+ 14
- 5
Marlin/src/module/motion.h View File

113
 #define XYZ_DEFS(T, NAME, OPT) \
113
 #define XYZ_DEFS(T, NAME, OPT) \
114
   extern const XYZval<T> NAME##_P; \
114
   extern const XYZval<T> NAME##_P; \
115
   FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); } \
115
   FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); } \
116
-  typedef void __void_##OPT##__
116
+  typedef void __void_##OPT##__ /* for semicolon */
117
 
117
 
118
 XYZ_DEFS(float, base_min_pos,   MIN_POS);
118
 XYZ_DEFS(float, base_min_pos,   MIN_POS);
119
 XYZ_DEFS(float, base_max_pos,   MAX_POS);
119
 XYZ_DEFS(float, base_max_pos,   MAX_POS);
200
  * Blocking movement and shorthand functions
200
  * Blocking movement and shorthand functions
201
  */
201
  */
202
 void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f);
202
 void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f);
203
-void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f);
204
-void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f);
205
-void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f);
206
-void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
207
 
203
 
208
 FORCE_INLINE void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
204
 FORCE_INLINE void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
209
   do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s);
205
   do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s);
214
 FORCE_INLINE void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
210
 FORCE_INLINE void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
215
   do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
211
   do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
216
 }
212
 }
213
+
214
+void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
215
+
217
 FORCE_INLINE void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
216
 FORCE_INLINE void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
218
   do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
217
   do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
219
 }
218
 }
219
+FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
220
+  do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
221
+}
222
+FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) {
223
+  do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
224
+}
225
+
226
+void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f);
227
+void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f);
228
+void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f);
220
 
229
 
221
 void remember_feedrate_and_scaling();
230
 void remember_feedrate_and_scaling();
222
 void remember_feedrate_scaling_off();
231
 void remember_feedrate_scaling_off();

Loading…
Cancel
Save