Skip to content

Commit 98a17cd

Browse files
committed
♻️ Rename XATC z_values => z_offset
1 parent aae08e9 commit 98a17cd

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

Marlin/src/feature/bedlevel/abl/x_twist.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
XATC xatc;
2929

3030
float XATC::spacing, XATC::start;
31-
xatc_points_t XATC::z_values;
31+
xatc_array_t XATC::z_offset;
3232

3333
void XATC::print_points() {
3434
SERIAL_ECHOLNPGM(" X-Twist Correction:");
3535
LOOP_L_N(x, XATC_MAX_POINTS) {
3636
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);
4040
}
4141
else {
4242
LOOP_L_N(i, 6)
@@ -54,7 +54,7 @@ float XATC::compensation(const xy_pos_t &raw) {
5454
int i = FLOOR(t);
5555
LIMIT(i, 0, XATC_MAX_POINTS - 2);
5656
t -= i;
57-
return lerp(t, z_values[i], z_values[i + 1]);
57+
return lerp(t, z_offset[i], z_offset[i + 1]);
5858
}
5959

6060
#endif // X_AXIS_TWIST_COMPENSATION

Marlin/src/feature/bedlevel/abl/x_twist.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323

2424
#include "../../../inc/MarlinConfigPre.h"
2525

26-
typedef float xatc_points_t[XATC_MAX_POINTS];
26+
typedef float xatc_array_t[XATC_MAX_POINTS];
2727

2828
class XATC {
2929
public:
3030
static float spacing, start;
31-
static xatc_points_t z_values;
31+
static xatc_array_t z_offset;
3232

3333
static float compensation(const xy_pos_t &raw);
3434
static void print_points();

Marlin/src/lcd/menu/menu_x_twist.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void xatc_wizard_update_z_offset() {
7777
//
7878
void xatc_wizard_set_offset_and_go_to_next_point() {
7979
// 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;
8181
// Go to next point
8282
ui.goto_screen(xatc_wizard_goto_next_point);
8383
}
@@ -160,12 +160,12 @@ void xatc_wizard_goto_next_point() {
160160
else {
161161
// Compute the z-offset by averaging the values found with this wizard
162162
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];
164164
z_offset /= XATC_MAX_POINTS;
165165

166166
// Subtract the average from the values found with this wizard.
167167
// 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;
169169

170170
ui.goto_screen(xatc_wizard_update_z_offset);
171171
}

Marlin/src/module/settings.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,7 @@ void MarlinSettings::postprocess() {
863863
"Bilinear Z array is the wrong size."
864864
);
865865
#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.");
870867
#endif
871868
#else
872869
const xy_pos_t bilinear_start{0}, bilinear_grid_spacing{0};

0 commit comments

Comments
 (0)