Browse Source

Merge pull request #6552 from thinkyhead/rc_more_ubl_cleanup

Further cleanup of UBL
Scott Lahteine 7 years ago
parent
commit
628391304f

+ 10
- 10
Marlin/G26_Mesh_Validation_Tool.cpp View File

@@ -258,8 +258,8 @@
258 258
         : find_closest_circle_to_print(x_pos, y_pos); // Find the closest Mesh Intersection to where we are now.
259 259
 
260 260
       if (location.x_index >= 0 && location.y_index >= 0) {
261
-        const float circle_x = pgm_read_float(&(ubl.mesh_index_to_xpos[location.x_index])),
262
-                    circle_y = pgm_read_float(&(ubl.mesh_index_to_ypos[location.y_index]));
261
+        const float circle_x = pgm_read_float(&ubl.mesh_index_to_xpos[location.x_index]),
262
+                    circle_y = pgm_read_float(&ubl.mesh_index_to_ypos[location.y_index]);
263 263
 
264 264
         // Let's do a couple of quick sanity checks.  We can pull this code out later if we never see it catch a problem
265 265
         #ifdef DELTA
@@ -401,8 +401,8 @@
401 401
     for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
402 402
       for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
403 403
         if (!is_bit_set(circle_flags, i, j)) {
404
-          const float mx = pgm_read_float(&(ubl.mesh_index_to_xpos[i])),  // We found a circle that needs to be printed
405
-                      my = pgm_read_float(&(ubl.mesh_index_to_ypos[j]));
404
+          const float mx = pgm_read_float(&ubl.mesh_index_to_xpos[i]),  // We found a circle that needs to be printed
405
+                      my = pgm_read_float(&ubl.mesh_index_to_ypos[j]);
406 406
 
407 407
           // Get the distance to this intersection
408 408
           float f = HYPOT(X - mx, Y - my);
@@ -446,11 +446,11 @@
446 446
               // We found two circles that need a horizontal line to connect them
447 447
               // Print it!
448 448
               //
449
-              sx = pgm_read_float(&(ubl.mesh_index_to_xpos[  i  ])) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // right edge
450
-              ex = pgm_read_float(&(ubl.mesh_index_to_xpos[i + 1])) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // left edge
449
+              sx = pgm_read_float(&ubl.mesh_index_to_xpos[  i  ]) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // right edge
450
+              ex = pgm_read_float(&ubl.mesh_index_to_xpos[i + 1]) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // left edge
451 451
 
452 452
               sx = constrain(sx, X_MIN_POS + 1, X_MAX_POS - 1);
453
-              sy = ey = constrain(pgm_read_float(&(ubl.mesh_index_to_ypos[j])), Y_MIN_POS + 1, Y_MAX_POS - 1);
453
+              sy = ey = constrain(pgm_read_float(&ubl.mesh_index_to_ypos[j]), Y_MIN_POS + 1, Y_MAX_POS - 1);
454 454
               ex = constrain(ex, X_MIN_POS + 1, X_MAX_POS - 1);
455 455
 
456 456
               if (ubl.g26_debug_flag) {
@@ -477,10 +477,10 @@
477 477
                 // We found two circles that need a vertical line to connect them
478 478
                 // Print it!
479 479
                 //
480
-                sy = pgm_read_float(&(ubl.mesh_index_to_ypos[  j  ])) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // top edge
481
-                ey = pgm_read_float(&(ubl.mesh_index_to_ypos[j + 1])) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // bottom edge
480
+                sy = pgm_read_float(&ubl.mesh_index_to_ypos[  j  ]) + (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // top edge
481
+                ey = pgm_read_float(&ubl.mesh_index_to_ypos[j + 1]) - (SIZE_OF_INTERSECTION_CIRCLES - (SIZE_OF_CROSSHAIRS)); // bottom edge
482 482
 
483
-                sx = ex = constrain(pgm_read_float(&(ubl.mesh_index_to_xpos[i])), X_MIN_POS + 1, X_MAX_POS - 1);
483
+                sx = ex = constrain(pgm_read_float(&ubl.mesh_index_to_xpos[i]), X_MIN_POS + 1, X_MAX_POS - 1);
484 484
                 sy = constrain(sy, Y_MIN_POS + 1, Y_MAX_POS - 1);
485 485
                 ey = constrain(ey, Y_MIN_POS + 1, Y_MAX_POS - 1);
486 486
 

+ 7
- 7
Marlin/Marlin_main.cpp View File

@@ -4919,7 +4919,7 @@ void home_all_axes() { gcode_G28(); }
4919 4919
       // For LINEAR and 3POINT leveling correct the current position
4920 4920
 
4921 4921
       if (verbose_level > 0)
4922
-        planner.bed_level_matrix.debug("\n\nBed Level Correction Matrix:");
4922
+        planner.bed_level_matrix.debug(PSTR("\n\nBed Level Correction Matrix:"));
4923 4923
 
4924 4924
       if (!dryrun) {
4925 4925
         //
@@ -6965,7 +6965,7 @@ inline void gcode_M111() {
6965 6965
     for (uint8_t i = 0; i < COUNT(debug_strings); i++) {
6966 6966
       if (TEST(marlin_debug_flags, i)) {
6967 6967
         if (comma++) SERIAL_CHAR(',');
6968
-        serialprintPGM((char*)pgm_read_word(&(debug_strings[i])));
6968
+        serialprintPGM((char*)pgm_read_word(&debug_strings[i]));
6969 6969
       }
6970 6970
     }
6971 6971
   }
@@ -8360,7 +8360,7 @@ void quickstop_stepper() {
8360 8360
     // V to print the matrix or mesh
8361 8361
     if (code_seen('V')) {
8362 8362
       #if ABL_PLANAR
8363
-        planner.bed_level_matrix.debug("Bed Level Correction Matrix:");
8363
+        planner.bed_level_matrix.debug(PSTR("Bed Level Correction Matrix:"));
8364 8364
       #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
8365 8365
         if (bilinear_grid_spacing[X_AXIS]) {
8366 8366
           print_bilinear_leveling_grid();
@@ -9545,16 +9545,16 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
9545 9545
 
9546 9546
             #if ENABLED(DEBUG_LEVELING_FEATURE)
9547 9547
               if (DEBUGGING(LEVELING)) {
9548
-                tmp_offset_vec.debug("tmp_offset_vec");
9549
-                act_offset_vec.debug("act_offset_vec");
9550
-                offset_vec.debug("offset_vec (BEFORE)");
9548
+                tmp_offset_vec.debug(PSTR("tmp_offset_vec"));
9549
+                act_offset_vec.debug(PSTR("act_offset_vec"));
9550
+                offset_vec.debug(PSTR("offset_vec (BEFORE)"));
9551 9551
               }
9552 9552
             #endif
9553 9553
 
9554 9554
             offset_vec.apply_rotation(planner.bed_level_matrix.transpose(planner.bed_level_matrix));
9555 9555
 
9556 9556
             #if ENABLED(DEBUG_LEVELING_FEATURE)
9557
-              if (DEBUGGING(LEVELING)) offset_vec.debug("offset_vec (AFTER)");
9557
+              if (DEBUGGING(LEVELING)) offset_vec.debug(PSTR("offset_vec (AFTER)"));
9558 9558
             #endif
9559 9559
 
9560 9560
             // Adjustments to the current position

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h View File

@@ -452,7 +452,7 @@
452 452
 
453 453
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
454 454
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 17) // mm
455
-  
455
+
456 456
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
457 457
   #define DELTA_AUTO_CALIBRATION
458 458
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 1
- 1
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h View File

@@ -459,7 +459,7 @@
459 459
 
460 460
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
461 461
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 17) // mm
462
-  
462
+
463 463
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
464 464
   //#define DELTA_AUTO_CALIBRATION
465 465
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration.h View File

@@ -448,7 +448,7 @@
448 448
 
449 449
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
450 450
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 28) // mm
451
-  
451
+
452 452
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
453 453
   //#define DELTA_AUTO_CALIBRATION
454 454
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration.h View File

@@ -448,7 +448,7 @@
448 448
 
449 449
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
450 450
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 18) // mm
451
-  
451
+
452 452
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
453 453
   //#define DELTA_AUTO_CALIBRATION
454 454
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration.h View File

@@ -435,7 +435,7 @@
435 435
 
436 436
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
437 437
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 25.4) // mm
438
-  
438
+
439 439
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
440 440
   //#define DELTA_AUTO_CALIBRATION
441 441
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration.h View File

@@ -453,7 +453,7 @@
453 453
 
454 454
   // set the radius for the calibration probe points - max 0.8 * DELTA_PRINTABLE_RADIUS if DELTA_AUTO_CALIBRATION enabled
455 455
   #define DELTA_CALIBRATION_RADIUS (DELTA_PRINTABLE_RADIUS - 28) // mm
456
-  
456
+
457 457
   // G33 Delta Auto-Calibration (Enable EEPROM_SETTINGS to store results)
458 458
   //#define DELTA_AUTO_CALIBRATION
459 459
   #if ENABLED(DELTA_AUTO_CALIBRATION)

+ 6
- 6
Marlin/least_squares_fit.cpp View File

@@ -66,12 +66,12 @@ int finish_incremental_LSF(struct linear_fit_data *lsf) {
66 66
   lsf->xbar /= N;
67 67
   lsf->ybar /= N;
68 68
   lsf->zbar /= N;
69
-  lsf->x2bar = lsf->x2bar / N - lsf->xbar * lsf->xbar;
70
-  lsf->y2bar = lsf->y2bar / N - lsf->ybar * lsf->ybar;
71
-  lsf->z2bar = lsf->z2bar / N - lsf->zbar * lsf->zbar;
72
-  lsf->xybar = lsf->xybar / N - lsf->xbar * lsf->ybar;
73
-  lsf->yzbar = lsf->yzbar / N - lsf->ybar * lsf->zbar;
74
-  lsf->xzbar = lsf->xzbar / N - lsf->xbar * lsf->zbar;
69
+  lsf->x2bar = lsf->x2bar / N - sq(lsf->xbar);
70
+  lsf->y2bar = lsf->y2bar / N - sq(lsf->ybar);
71
+  lsf->z2bar = lsf->z2bar / N - sq(lsf->zbar);
72
+  lsf->xybar = lsf->xybar / N - sq(lsf->xbar);
73
+  lsf->yzbar = lsf->yzbar / N - sq(lsf->ybar);
74
+  lsf->xzbar = lsf->xzbar / N - sq(lsf->xbar);
75 75
 
76 76
   const float DD = lsf->x2bar * lsf->y2bar - sq(lsf->xybar);
77 77
   if (fabs(DD) <= 1e-10 * (lsf->max_absx + lsf->max_absy))

+ 394
- 422
Marlin/ubl_G29.cpp
File diff suppressed because it is too large
View File


+ 14
- 14
Marlin/ubl_motion.cpp View File

@@ -154,7 +154,7 @@
154 154
        * to create a 1-over number for us. That will allow us to do a floating point multiply instead of a floating point divide.
155 155
        */
156 156
 
157
-      const float xratio = (RAW_X_POSITION(end[X_AXIS]) - pgm_read_float(&(ubl.mesh_index_to_xpos[cell_dest_xi]))) * (1.0 / (MESH_X_DIST)),
157
+      const float xratio = (RAW_X_POSITION(end[X_AXIS]) - pgm_read_float(&ubl.mesh_index_to_xpos[cell_dest_xi])) * (1.0 / (MESH_X_DIST)),
158 158
                   z1 = ubl.z_values[cell_dest_xi    ][cell_dest_yi    ] + xratio *
159 159
                       (ubl.z_values[cell_dest_xi + 1][cell_dest_yi    ] - ubl.z_values[cell_dest_xi][cell_dest_yi    ]),
160 160
                   z2 = ubl.z_values[cell_dest_xi    ][cell_dest_yi + 1] + xratio *
@@ -163,7 +163,7 @@
163 163
       // we are done with the fractional X distance into the cell. Now with the two Z-Heights we have calculated, we
164 164
       // are going to apply the Y-Distance into the cell to interpolate the final Z correction.
165 165
 
166
-      const float yratio = (RAW_Y_POSITION(end[Y_AXIS]) - pgm_read_float(&(ubl.mesh_index_to_ypos[cell_dest_yi]))) * (1.0 / (MESH_Y_DIST));
166
+      const float yratio = (RAW_Y_POSITION(end[Y_AXIS]) - pgm_read_float(&ubl.mesh_index_to_ypos[cell_dest_yi])) * (1.0 / (MESH_Y_DIST));
167 167
 
168 168
       float z0 = z1 + (z2 - z1) * yratio;
169 169
 
@@ -198,8 +198,8 @@
198 198
     const float dx = end[X_AXIS] - start[X_AXIS],
199 199
                 dy = end[Y_AXIS] - start[Y_AXIS];
200 200
 
201
-    const int left_flag = dx < 0.0 ? 1.0 : 0.0,
202
-              down_flag = dy < 0.0 ? 1.0 : 0.0;
201
+    const int left_flag = dx < 0.0 ? 1 : 0,
202
+              down_flag = dy < 0.0 ? 1 : 0;
203 203
 
204 204
     const float adx = left_flag ? -dx : dx,
205 205
                 ady = down_flag ? -dy : dy;
@@ -230,8 +230,8 @@
230 230
     const float m = dy / dx,
231 231
                 c = start[Y_AXIS] - m * start[X_AXIS];
232 232
 
233
-    const bool inf_normalized_flag=isinf(e_normalized_dist),
234
-               inf_m_flag=isinf(m);
233
+    const bool inf_normalized_flag = isinf(e_normalized_dist),
234
+               inf_m_flag = isinf(m);
235 235
     /**
236 236
      * This block handles vertical lines. These are lines that stay within the same
237 237
      * X Cell column. They do not need to be perfectly vertical. They just can
@@ -241,7 +241,7 @@
241 241
       current_yi += down_flag;  // Line is heading down, we just want to go to the bottom
242 242
       while (current_yi != cell_dest_yi + down_flag) {
243 243
         current_yi += dyi;
244
-        const float next_mesh_line_y = LOGICAL_Y_POSITION(pgm_read_float(&(ubl.mesh_index_to_ypos[current_yi])));
244
+        const float next_mesh_line_y = LOGICAL_Y_POSITION(pgm_read_float(&ubl.mesh_index_to_ypos[current_yi]));
245 245
 
246 246
         /**
247 247
          * if the slope of the line is infinite, we won't do the calculations
@@ -263,7 +263,7 @@
263 263
          */
264 264
         if (isnan(z0)) z0 = 0.0;
265 265
 
266
-        const float y = LOGICAL_Y_POSITION(pgm_read_float(&(ubl.mesh_index_to_ypos[current_yi])));
266
+        const float y = LOGICAL_Y_POSITION(pgm_read_float(&ubl.mesh_index_to_ypos[current_yi]));
267 267
 
268 268
         /**
269 269
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
@@ -274,7 +274,7 @@
274 274
         if (y != start[Y_AXIS]) {
275 275
           if (!inf_normalized_flag) {
276 276
 
277
-            //on_axis_distance = y - start[Y_AXIS];                               
277
+            //on_axis_distance = y - start[Y_AXIS];
278 278
             on_axis_distance = use_x_dist ? x - start[X_AXIS] : y - start[Y_AXIS];
279 279
 
280 280
             //on_axis_distance = use_x_dist ? next_mesh_line_x - start[X_AXIS] : y - start[Y_AXIS];
@@ -283,7 +283,7 @@
283 283
             //on_axis_distance = use_x_dist ? next_mesh_line_x - start[X_AXIS] : y - start[Y_AXIS];
284 284
             //on_axis_distance = use_x_dist ? x - start[X_AXIS] : next_mesh_line_y - start[Y_AXIS];
285 285
 
286
-            e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist;  
286
+            e_position = start[E_AXIS] + on_axis_distance * e_normalized_dist;
287 287
             z_position = start[Z_AXIS] + on_axis_distance * z_normalized_dist;
288 288
           }
289 289
           else {
@@ -321,7 +321,7 @@
321 321
                                 // edge of this cell for the first move.
322 322
       while (current_xi != cell_dest_xi + left_flag) {
323 323
         current_xi += dxi;
324
-        const float next_mesh_line_x = LOGICAL_X_POSITION(pgm_read_float(&(ubl.mesh_index_to_xpos[current_xi]))),
324
+        const float next_mesh_line_x = LOGICAL_X_POSITION(pgm_read_float(&ubl.mesh_index_to_xpos[current_xi])),
325 325
                     y = m * next_mesh_line_x + c;   // Calculate Y at the next X mesh line
326 326
 
327 327
         float z0 = ubl.z_correction_for_y_on_vertical_mesh_line(y, current_xi, current_yi);
@@ -337,7 +337,7 @@
337 337
          */
338 338
         if (isnan(z0)) z0 = 0.0;
339 339
 
340
-        const float x = LOGICAL_X_POSITION(pgm_read_float(&(ubl.mesh_index_to_xpos[current_xi])));
340
+        const float x = LOGICAL_X_POSITION(pgm_read_float(&ubl.mesh_index_to_xpos[current_xi]));
341 341
 
342 342
         /**
343 343
          * Without this check, it is possible for the algorithm to generate a zero length move in the case
@@ -393,8 +393,8 @@
393 393
 
394 394
     while (xi_cnt > 0 || yi_cnt > 0) {
395 395
 
396
-      const float next_mesh_line_x = LOGICAL_X_POSITION(pgm_read_float(&(ubl.mesh_index_to_xpos[current_xi + dxi]))),
397
-                  next_mesh_line_y = LOGICAL_Y_POSITION(pgm_read_float(&(ubl.mesh_index_to_ypos[current_yi + dyi]))),
396
+      const float next_mesh_line_x = LOGICAL_X_POSITION(pgm_read_float(&ubl.mesh_index_to_xpos[current_xi + dxi])),
397
+                  next_mesh_line_y = LOGICAL_Y_POSITION(pgm_read_float(&ubl.mesh_index_to_ypos[current_yi + dyi])),
398 398
                   y = m * next_mesh_line_x + c,   // Calculate Y at the next X mesh line
399 399
                   x = (next_mesh_line_y - c) / m; // Calculate X at the next Y mesh line
400 400
                                                   // (No need to worry about m being zero.

+ 13
- 13
Marlin/vector_3.cpp View File

@@ -63,7 +63,7 @@ vector_3 vector_3::get_normal() {
63 63
   return normalized;
64 64
 }
65 65
 
66
-float vector_3::get_length() { return sqrt((x * x) + (y * y) + (z * z)); }
66
+float vector_3::get_length() { return sqrt(sq(x) + sq(y) + sq(z)); }
67 67
 
68 68
 void vector_3::normalize() {
69 69
   const float inv_length = 1.0 / get_length();
@@ -81,8 +81,8 @@ void vector_3::apply_rotation(matrix_3x3 matrix) {
81 81
   z = resultZ;
82 82
 }
83 83
 
84
-void vector_3::debug(const char title[]) {
85
-  SERIAL_PROTOCOL(title);
84
+void vector_3::debug(const char * const title) {
85
+  serialprintPGM(title);
86 86
   SERIAL_PROTOCOLPGM(" x: ");
87 87
   SERIAL_PROTOCOL_F(x, 6);
88 88
   SERIAL_PROTOCOLPGM(" y: ");
@@ -101,14 +101,14 @@ void apply_rotation_xyz(matrix_3x3 matrix, float &x, float &y, float &z) {
101 101
 }
102 102
 
103 103
 matrix_3x3 matrix_3x3::create_from_rows(vector_3 row_0, vector_3 row_1, vector_3 row_2) {
104
-  //row_0.debug("row_0");
105
-  //row_1.debug("row_1");
106
-  //row_2.debug("row_2");
104
+  //row_0.debug(PSTR("row_0"));
105
+  //row_1.debug(PSTR("row_1"));
106
+  //row_2.debug(PSTR("row_2"));
107 107
   matrix_3x3 new_matrix;
108 108
   new_matrix.matrix[0] = row_0.x; new_matrix.matrix[1] = row_0.y; new_matrix.matrix[2] = row_0.z;
109 109
   new_matrix.matrix[3] = row_1.x; new_matrix.matrix[4] = row_1.y; new_matrix.matrix[5] = row_1.z;
110 110
   new_matrix.matrix[6] = row_2.x; new_matrix.matrix[7] = row_2.y; new_matrix.matrix[8] = row_2.z;
111
-  //new_matrix.debug("new_matrix");
111
+  //new_matrix.debug(PSTR("new_matrix"));
112 112
   return new_matrix;
113 113
 }
114 114
 
@@ -123,14 +123,14 @@ matrix_3x3 matrix_3x3::create_look_at(vector_3 target) {
123 123
   vector_3 x_row = vector_3(1, 0, -target.x / target.z).get_normal();
124 124
   vector_3 y_row = vector_3::cross(z_row, x_row).get_normal();
125 125
 
126
-  // x_row.debug("x_row");
127
-  // y_row.debug("y_row");
128
-  // z_row.debug("z_row");
126
+  // x_row.debug(PSTR("x_row"));
127
+  // y_row.debug(PSTR("y_row"));
128
+  // z_row.debug(PSTR("z_row"));
129 129
 
130 130
   // create the matrix already correctly transposed
131 131
   matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row);
132 132
 
133
-  // rot.debug("rot");
133
+  // rot.debug(PSTR("rot"));
134 134
   return rot;
135 135
 }
136 136
 
@@ -142,8 +142,8 @@ matrix_3x3 matrix_3x3::transpose(matrix_3x3 original) {
142 142
   return new_matrix;
143 143
 }
144 144
 
145
-void matrix_3x3::debug(const char title[]) {
146
-  SERIAL_PROTOCOLLN(title);
145
+void matrix_3x3::debug(const char * const title) {
146
+  serialprintPGM(title);
147 147
   uint8_t count = 0;
148 148
   for (uint8_t i = 0; i < 3; i++) {
149 149
     for (uint8_t j = 0; j < 3; j++) {

+ 4
- 3
Marlin/vector_3.h View File

@@ -42,6 +42,7 @@
42 42
 #define VECTOR_3_H
43 43
 
44 44
 #if HAS_ABL
45
+
45 46
 class matrix_3x3;
46 47
 
47 48
 struct vector_3 {
@@ -58,7 +59,7 @@ struct vector_3 {
58 59
   float get_length();
59 60
   vector_3 get_normal();
60 61
 
61
-  void debug(const char title[]);
62
+  void debug(const char * const title);
62 63
 
63 64
   void apply_rotation(matrix_3x3 matrix);
64 65
 };
@@ -72,11 +73,11 @@ struct matrix_3x3 {
72 73
 
73 74
   void set_to_identity();
74 75
 
75
-  void debug(const char title[]);
76
+  void debug(const char * const title);
76 77
 };
77 78
 
78 79
 
79 80
 void apply_rotation_xyz(matrix_3x3 rotationMatrix, float& x, float& y, float& z);
80
-#endif // HAS_ABL
81 81
 
82
+#endif // HAS_ABL
82 83
 #endif // VECTOR_3_H

Loading…
Cancel
Save