Add a feedRate_t data type (#15349)

This commit is contained in:
Scott Lahteine
2019-09-26 01:28:09 -05:00
committed by GitHub
parent ee7558a622
commit 455dabb183
42 changed files with 384 additions and 377 deletions

View File

@ -64,7 +64,7 @@
* Prepare a mesh-leveled linear move in a Cartesian setup,
* splitting the move where it crosses mesh borders.
*/
void mesh_bed_leveling::line_to_destination(const float fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
void mesh_bed_leveling::line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
// Get current and destination cells for this line
int cx1 = cell_index_x(current_position[X_AXIS]),
cy1 = cell_index_y(current_position[Y_AXIS]),
@ -77,7 +77,7 @@
// Start and end in the same cell? No split needed.
if (cx1 == cx2 && cy1 == cy2) {
line_to_destination(fr_mm_s);
line_to_destination(scaled_fr_mm_s);
set_current_from_destination();
return;
}
@ -109,7 +109,7 @@
else {
// Must already have been split on these border(s)
// This should be a rare case.
line_to_destination(fr_mm_s);
line_to_destination(scaled_fr_mm_s);
set_current_from_destination();
return;
}
@ -118,11 +118,11 @@
destination[E_AXIS] = MBL_SEGMENT_END(E);
// Do the split and look for more borders
line_to_destination(fr_mm_s, x_splits, y_splits);
line_to_destination(scaled_fr_mm_s, x_splits, y_splits);
// Restore destination from stack
COPY(destination, end);
line_to_destination(fr_mm_s, x_splits, y_splits);
line_to_destination(scaled_fr_mm_s, x_splits, y_splits);
}
#endif // IS_CARTESIAN && !SEGMENT_LEVELED_MOVES

View File

@ -116,7 +116,7 @@ public:
}
#if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
static void line_to_destination(const float fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
#endif
};