Skip to content

Commit

Permalink
Fix meshCount signed-ness
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 31, 2019
1 parent 899e0fc commit e3ddf6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ G29_TYPE GcodeSuite::G29() {
#if ABL_GRID

#if ENABLED(PROBE_MANUALLY)
ABL_VAR xy_int8_t meshCount;
ABL_VAR xy_uint8_t meshCount;
#endif

ABL_VAR xy_int_t probe_position_lf, probe_position_rb;
Expand Down Expand Up @@ -678,7 +678,7 @@ G29_TYPE GcodeSuite::G29() {

measured_z = 0;

xy_int8_t meshCount;
xy_uint8_t meshCount;

// Outer loop is X with PROBE_Y_FIRST enabled
// Outer loop is Y with PROBE_Y_FIRST disabled
Expand Down Expand Up @@ -746,7 +746,7 @@ G29_TYPE GcodeSuite::G29() {

z_values[meshCount.x][meshCount.y] = measured_z + zoffset;
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onMeshUpdate(meshCount.x, meshCount.y, z_values[meshCount.x][meshCount.y]);
ExtUI::onMeshUpdate(meshCount, z_values[meshCount.x][meshCount.y]);
#endif

#endif
Expand Down

2 comments on commit e3ddf6e

@amordue
Copy link

@amordue amordue commented on e3ddf6e Nov 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might break things with abl as the probing inner loop will try and continue forever when !zig ing as PR_INNER_VAR (which is meshCount.x) can never equal inStop, which is -1

for (PR_INNER_VAR = inStart; PR_INNER_VAR != inStop; pt_index++, PR_INNER_VAR += inInc) {

Thanks

@thinkyhead
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh! Thank you for the note. I will patch this asap.

Please sign in to comment.