Bläddra i källkod

♻️ Rename XATC z_values => z_offset

Scott Lahteine 3 år sedan
förälder
incheckning
98a17cd60d

+ 5
- 5
Marlin/src/feature/bedlevel/abl/x_twist.cpp Visa fil

@@ -28,15 +28,15 @@
28 28
 XATC xatc;
29 29
 
30 30
 float XATC::spacing, XATC::start;
31
-xatc_points_t XATC::z_values;
31
+xatc_array_t XATC::z_offset;
32 32
 
33 33
 void XATC::print_points() {
34 34
   SERIAL_ECHOLNPGM(" X-Twist Correction:");
35 35
   LOOP_L_N(x, XATC_MAX_POINTS) {
36 36
     SERIAL_CHAR(' ');
37
-    if (!isnan(z_values[x])) {
38
-      if (z_values[x] >= 0) SERIAL_CHAR('+');
39
-      SERIAL_ECHO_F(z_values[x], 3);
37
+    if (!isnan(z_offset[x])) {
38
+      if (z_offset[x] >= 0) SERIAL_CHAR('+');
39
+      SERIAL_ECHO_F(z_offset[x], 3);
40 40
     }
41 41
     else {
42 42
       LOOP_L_N(i, 6)
@@ -54,7 +54,7 @@ float XATC::compensation(const xy_pos_t &raw) {
54 54
   int i = FLOOR(t);
55 55
   LIMIT(i, 0, XATC_MAX_POINTS - 2);
56 56
   t -= i;
57
-  return lerp(t, z_values[i], z_values[i + 1]);
57
+  return lerp(t, z_offset[i], z_offset[i + 1]);
58 58
 }
59 59
 
60 60
 #endif // X_AXIS_TWIST_COMPENSATION

+ 2
- 2
Marlin/src/feature/bedlevel/abl/x_twist.h Visa fil

@@ -23,12 +23,12 @@
23 23
 
24 24
 #include "../../../inc/MarlinConfigPre.h"
25 25
 
26
-typedef float xatc_points_t[XATC_MAX_POINTS];
26
+typedef float xatc_array_t[XATC_MAX_POINTS];
27 27
 
28 28
 class XATC {
29 29
 public:
30 30
   static float spacing, start;
31
-  static xatc_points_t z_values;
31
+  static xatc_array_t z_offset;
32 32
 
33 33
   static float compensation(const xy_pos_t &raw);
34 34
   static void print_points();

+ 3
- 3
Marlin/src/lcd/menu/menu_x_twist.cpp Visa fil

@@ -77,7 +77,7 @@ void xatc_wizard_update_z_offset() {
77 77
 //
78 78
 void xatc_wizard_set_offset_and_go_to_next_point() {
79 79
   // Set Z-offset at probed point
80
-  xatc.z_values[manual_probe_index++] = probe.offset.z + current_position.z - measured_z;
80
+  xatc.z_offset[manual_probe_index++] = probe.offset.z + current_position.z - measured_z;
81 81
   // Go to next point
82 82
   ui.goto_screen(xatc_wizard_goto_next_point);
83 83
 }
@@ -160,12 +160,12 @@ void xatc_wizard_goto_next_point() {
160 160
   else {
161 161
     // Compute the z-offset by averaging the values found with this wizard
162 162
     z_offset = 0;
163
-    LOOP_L_N(i, XATC_MAX_POINTS) z_offset += xatc.z_values[i];
163
+    LOOP_L_N(i, XATC_MAX_POINTS) z_offset += xatc.z_offset[i];
164 164
     z_offset /= XATC_MAX_POINTS;
165 165
 
166 166
     // Subtract the average from the values found with this wizard.
167 167
     // This way they are indipendent from the z-offset
168
-    LOOP_L_N(i, XATC_MAX_POINTS) xatc.z_values[i] -= z_offset;
168
+    LOOP_L_N(i, XATC_MAX_POINTS) xatc.z_offset[i] -= z_offset;
169 169
 
170 170
     ui.goto_screen(xatc_wizard_update_z_offset);
171 171
   }

+ 1
- 4
Marlin/src/module/settings.cpp Visa fil

@@ -863,10 +863,7 @@ void MarlinSettings::postprocess() {
863 863
           "Bilinear Z array is the wrong size."
864 864
         );
865 865
         #if ENABLED(X_AXIS_TWIST_COMPENSATION)
866
-          static_assert(
867
-            sizeof(xatc.z_values) == (XATC_MAX_POINTS) * sizeof(xatc.z_values[0]),
868
-            "Z-offset mesh is the wrong size."
869
-          );
866
+          static_assert(COUNT(xatc.z_offset) == XATC_MAX_POINTS, "XATC Z-offset mesh is the wrong size.");
870 867
         #endif
871 868
       #else
872 869
         const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0};

Laddar…
Avbryt
Spara