Scott Lahteine 4 anni fa
parent
commit
bfdd1f4662

+ 1
- 1
Marlin/src/feature/bedlevel/ubl/ubl.h Vedi File

@@ -57,7 +57,7 @@ typedef struct {
57 57
   xy_pos_t  XY_pos;
58 58
   xy_bool_t XY_seen;
59 59
   #if HAS_BED_PROBE
60
-    int     grid_size;
60
+    uint8_t J_grid_size;
61 61
   #endif
62 62
 } G29_parameters_t;
63 63
 

+ 9
- 9
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Vedi File

@@ -391,7 +391,7 @@ void unified_bed_leveling::G29() {
391 391
 
392 392
     if (parser.seen('J')) {
393 393
       save_ubl_active_state_and_disable();
394
-      tilt_mesh_based_on_probed_grid(param.grid_size == 0); // Zero size does 3-Point
394
+      tilt_mesh_based_on_probed_grid(param.J_grid_size == 0); // Zero size does 3-Point
395 395
       restore_ubl_active_state_and_leave();
396 396
       #if ENABLED(UBL_G29_J_RECENTER)
397 397
         do_blocking_move_to_xy(0.5f * ((MESH_MIN_X) + (MESH_MAX_X)), 0.5f * ((MESH_MIN_Y) + (MESH_MAX_Y)));
@@ -1118,8 +1118,8 @@ bool unified_bed_leveling::G29_parse_parameters() {
1118 1118
 
1119 1119
   if (parser.seen('J')) {
1120 1120
     #if HAS_BED_PROBE
1121
-      param.grid_size = parser.has_value() ? parser.value_int() : 0;
1122
-      if (param.grid_size && !WITHIN(param.grid_size, 2, 9)) {
1121
+      param.J_grid_size = parser.value_byte();
1122
+      if (param.J_grid_size && !WITHIN(param.J_grid_size, 2, 9)) {
1123 1123
         SERIAL_ECHOLNPGM("?Invalid grid size (J) specified (2-9).\n");
1124 1124
         err_flag = true;
1125 1125
       }
@@ -1420,8 +1420,8 @@ void unified_bed_leveling::smart_fill_mesh() {
1420 1420
   void unified_bed_leveling::tilt_mesh_based_on_probed_grid(const bool do_3_pt_leveling) {
1421 1421
     const float x_min = probe.min_x(), x_max = probe.max_x(),
1422 1422
                 y_min = probe.min_y(), y_max = probe.max_y(),
1423
-                dx = (x_max - x_min) / (param.grid_size - 1),
1424
-                dy = (y_max - y_min) / (param.grid_size - 1);
1423
+                dx = (x_max - x_min) / (param.J_grid_size - 1),
1424
+                dy = (y_max - y_min) / (param.J_grid_size - 1);
1425 1425
 
1426 1426
     xy_float_t points[3];
1427 1427
     probe.get_three_points(points);
@@ -1507,14 +1507,14 @@ void unified_bed_leveling::smart_fill_mesh() {
1507 1507
 
1508 1508
       bool zig_zag = false;
1509 1509
 
1510
-      const uint16_t total_points = sq(param.grid_size);
1510
+      const uint16_t total_points = sq(param.J_grid_size);
1511 1511
       uint16_t point_num = 1;
1512 1512
 
1513 1513
       xy_pos_t rpos;
1514
-      LOOP_L_N(ix, param.grid_size) {
1514
+      LOOP_L_N(ix, param.J_grid_size) {
1515 1515
         rpos.x = x_min + ix * dx;
1516
-        LOOP_L_N(iy, param.grid_size) {
1517
-          rpos.y = y_min + dy * (zig_zag ? param.grid_size - 1 - iy : iy);
1516
+        LOOP_L_N(iy, param.J_grid_size) {
1517
+          rpos.y = y_min + dy * (zig_zag ? param.J_grid_size - 1 - iy : iy);
1518 1518
 
1519 1519
           if (!abort_flag) {
1520 1520
             SERIAL_ECHOLNPAIR("Tilting mesh point ", point_num, "/", total_points, "\n");

Loading…
Annulla
Salva