Browse Source

Merge pull request #8565 from Roxy-3D/bugfix-2.0.x

Change G26 and G29 bit function names to avoid HAL name collision
Scott Lahteine 7 years ago
parent
commit
2f837ce9b7
No account linked to committer's email address

+ 3
- 3
Marlin/src/core/utility.h View File

@@ -40,9 +40,9 @@ void safe_delay(millis_t ms);
40 40
    * to unsigned long will allow us to go to 32x32 if higher resolution Mesh's are needed
41 41
    * in the future.
42 42
    */
43
-  FORCE_INLINE void bit_clear(uint16_t bits[16], const uint8_t x, const uint8_t y)  { CBI(bits[y], x); }
44
-  FORCE_INLINE void bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y)    { SBI(bits[y], x); }
45
-  FORCE_INLINE bool is_bit_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
43
+  FORCE_INLINE void bitmap_clear(uint16_t bits[16], const uint8_t x, const uint8_t y)  { CBI(bits[y], x); }
44
+  FORCE_INLINE void bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y)    { SBI(bits[y], x); }
45
+  FORCE_INLINE bool is_bitmap_set(uint16_t bits[16], const uint8_t x, const uint8_t y) { return TEST(bits[y], x); }
46 46
 #endif
47 47
 
48 48
 #if ENABLED(ULTRA_LCD)

+ 3
- 3
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

@@ -1422,7 +1422,7 @@
1422 1422
 
1423 1423
         if ( (type == INVALID && isnan(z_values[i][j]))  // Check to see if this location holds the right thing
1424 1424
           || (type == REAL && !isnan(z_values[i][j]))
1425
-          || (type == SET_IN_BITMAP && is_bit_set(bits, i, j))
1425
+          || (type == SET_IN_BITMAP && is_bitmap_set(bits, i, j))
1426 1426
         ) {
1427 1427
           // We only get here if we found a Mesh Point of the specified type
1428 1428
 
@@ -1490,8 +1490,8 @@
1490 1490
 
1491 1491
         if (location.x_index < 0) break; // stop when we can't find any more reachable points.
1492 1492
 
1493
-        bit_clear(not_done, location.x_index, location.y_index);  // Mark this location as 'adjusted' so we will find a
1494
-                                                                  // different location the next time through the loop
1493
+        bitmap_clear(not_done, location.x_index, location.y_index); // Mark this location as 'adjusted' so we will find a
1494
+                                                                    // different location the next time through the loop
1495 1495
 
1496 1496
         const float rawx = mesh_index_to_xpos(location.x_index),
1497 1497
                     rawy = mesh_index_to_ypos(location.y_index);

+ 8
- 8
Marlin/src/gcode/bedlevel/G26.cpp View File

@@ -194,7 +194,7 @@ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) {
194 194
 
195 195
   for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
196 196
     for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
197
-      if (!is_bit_set(circle_flags, i, j)) {
197
+      if (!is_bitmap_set(circle_flags, i, j)) {
198 198
         const float mx = _GET_MESH_X(i),  // We found a circle that needs to be printed
199 199
                     my = _GET_MESH_Y(j);
200 200
 
@@ -220,7 +220,7 @@ mesh_index_pair find_closest_circle_to_print(const float &X, const float &Y) {
220 220
       }
221 221
     }
222 222
   }
223
-  bit_set(circle_flags, return_val.x_index, return_val.y_index);   // Mark this location as done.
223
+  bitmap_set(circle_flags, return_val.x_index, return_val.y_index);   // Mark this location as done.
224 224
   return return_val;
225 225
 }
226 226
 
@@ -348,8 +348,8 @@ inline bool look_for_lines_to_connect() {
348 348
       if (i < GRID_MAX_POINTS_X) { // We can't connect to anything to the right than GRID_MAX_POINTS_X.
349 349
                                    // This is already a half circle because we are at the edge of the bed.
350 350
 
351
-        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
352
-          if (!is_bit_set(horizontal_mesh_line_flags, i, j)) {
351
+        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
352
+          if (!is_bitmap_set(horizontal_mesh_line_flags, i, j)) {
353 353
 
354 354
             //
355 355
             // We found two circles that need a horizontal line to connect them
@@ -376,15 +376,15 @@ inline bool look_for_lines_to_connect() {
376 376
 
377 377
               print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height);
378 378
             }
379
-            bit_set(horizontal_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if we skipped it
379
+            bitmap_set(horizontal_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if we skipped it
380 380
           }
381 381
         }
382 382
 
383 383
         if (j < GRID_MAX_POINTS_Y) { // We can't connect to anything further back than GRID_MAX_POINTS_Y.
384 384
                                          // This is already a half circle because we are at the edge  of the bed.
385 385
 
386
-          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
387
-            if (!is_bit_set( vertical_mesh_line_flags, i, j)) {
386
+          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
387
+            if (!is_bitmap_set( vertical_mesh_line_flags, i, j)) {
388 388
               //
389 389
               // We found two circles that need a vertical line to connect them
390 390
               // Print it!
@@ -412,7 +412,7 @@ inline bool look_for_lines_to_connect() {
412 412
                 }
413 413
                 print_line_from_here_to_there(sx, sy, g26_layer_height, ex, ey, g26_layer_height);
414 414
               }
415
-              bit_set(vertical_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if skipped
415
+              bitmap_set(vertical_mesh_line_flags, i, j);   // Mark it as done so we don't do it again, even if skipped
416 416
             }
417 417
           }
418 418
         }

Loading…
Cancel
Save