From 3e9e94801fbd44a2bccfaf9d1c6807700b0c3dfc Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Sun, 2 Apr 2017 12:56:44 -0500 Subject: [PATCH] Fix problem described in issue # 6175 As it turns out... an unsigned int can not go to less than 0, so the loop never terminates. --- Marlin/UBL_Bed_Leveling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/UBL_Bed_Leveling.cpp b/Marlin/UBL_Bed_Leveling.cpp index 414099b768..6bf29dc7c2 100644 --- a/Marlin/UBL_Bed_Leveling.cpp +++ b/Marlin/UBL_Bed_Leveling.cpp @@ -193,7 +193,7 @@ const float current_xi = ubl.get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0), current_yi = ubl.get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0); - for (uint8_t j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) { + for (int8_t j = UBL_MESH_NUM_Y_POINTS - 1; j >= 0; j--) { for (uint8_t i = 0; i < UBL_MESH_NUM_X_POINTS; i++) { const bool is_current = i == current_xi && j == current_yi;