From e48fcad615092e34ae0dcf2e08753fb03f525b8f Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Sat, 25 Nov 2017 19:35:27 -0600 Subject: [PATCH] change G26 and G29 bit function names to avoid HAL collision --- Marlin/src/core/utility.h | 6 +++--- Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp | 6 +++--- Marlin/src/gcode/bedlevel/G26.cpp | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Marlin/src/core/utility.h b/Marlin/src/core/utility.h index 7717478085..93d97b3e5d 100644 --- a/Marlin/src/core/utility.h +++ b/Marlin/src/core/utility.h @@ -40,9 +40,9 @@ void safe_delay(millis_t ms); * to unsigned long will allow us to go to 32x32 if higher resolution Mesh's are needed * in the future. */ - FORCE_INLINE void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); } - FORCE_INLINE void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); } - FORCE_INLINE bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } + FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y) { CBI(bits[y], x); } + FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { SBI(bits[y], x); } + FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); } #endif #if ENABLED(ULTRA_LCD) diff --git a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp index 14e04bcf73..641d67ed8f 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp @@ -1422,7 +1422,7 @@ if ( (type == INVALID && isnan(z_values[i][j])) // Check to see if this location holds the right thing || (type == REAL && !isnan(z_values[i][j])) - || (type == SET_IN_BITMAP && is_bit_set(bits, i, j)) + || (type == SET_IN_BITMAP && is_bitmap_set(bits, i, j)) ) { // We only get here if we found a Mesh Point of the specified type @@ -1490,8 +1490,8 @@ if (location.x_index < 0) break; // stop when we can't find any more reachable points. - bit_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a - // different location the next time through the loop + bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a + // different location the next time through the loop const float rawx = mesh_index_to_xpos(location.x_index), rawy = mesh_index_to_ypos(location.y_index); diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 2849674a86..98499c7ee1 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -194,7 +194,7 @@ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { - if (!is_bit_set(circle_flags, i, j)) { + if (!is_bitmap_set(circle_flags, i, j)) { const float mx = _GET_MESH_X(i), // We found a circle that needs to be printed my = _GET_MESH_Y(j); @@ -220,7 +220,7 @@ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) { } } } - bit_set(circle_flags, return_val.x_index, return_val.y_index); // Mark this location as done. + bitmap_set(circle_flags, return_val.x_index, return_val.y_index); // Mark this location as done. return return_val; } @@ -348,8 +348,8 @@ inline bool look_for_lines_to_connect() { if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X. // This is already a half circle because we are at the edge of the bed. - if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i + 1, j)) { // check if we can do a line to the left - if (!is_bit_set(horizontal_mesh_line_flags, i, j)) { + if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i + 1, j)) { // check if we can do a line to the left + if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) { // // We found two circles that need a horizontal line to connect them @@ -376,15 +376,15 @@ inline bool look_for_lines_to_connect() { print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); } - bit_set(horizontal_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if we skipped it + bitmap_set(horizontal_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if we skipped it } } if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y. // This is already a half circle because we are at the edge of the bed. - if (is_bit_set(circle_flags, i, j) && is_bit_set(circle_flags, i, j + 1)) { // check if we can do a line straight down - if (!is_bit_set( vertical_mesh_line_flags, i, j)) { + if (is_bitmap_set(circle_flags, i, j) && is_bitmap_set(circle_flags, i, j + 1)) { // check if we can do a line straight down + if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) { // // We found two circles that need a vertical line to connect them // Print it! @@ -412,7 +412,7 @@ inline bool look_for_lines_to_connect() { } print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height); } - bit_set(vertical_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if skipped + bitmap_set(vertical_mesh_line_flags, i, j); // Mark it as done so we don't do it again, even if skipped } } }