Browse Source

Add array indexIntoAB[xx][yy]

and use it.
pull/1/head
AnHardt 9 years ago
committed by Richard Wackerbarth
parent
commit
3d23424121
  1. 7
      Marlin/Marlin_main.cpp

7
Marlin/Marlin_main.cpp

@ -2561,6 +2561,7 @@ inline void gcode_G28() {
double eqnAMatrix[abl2 * 3], // "A" matrix of the linear system of equations
eqnBVector[abl2], // "B" vector of Z points
mean = 0.0;
int8_t indexIntoAB[auto_bed_leveling_grid_points][auto_bed_leveling_grid_points];
#endif // !DELTA
int probePointCounter = 0;
@ -2625,7 +2626,7 @@ inline void gcode_G28() {
bed_level[xCount][yCount] = measured_z + z_offset;
#endif
probePointCounter++;
indexIntoAB[xCount][yCount] = probePointCounter++;
idle();
@ -2679,7 +2680,7 @@ inline void gcode_G28() {
for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
int ind = yy * auto_bed_leveling_grid_points + xx;
int ind = indexIntoAB[xx][yy];
float diff = eqnBVector[ind] - mean;
float x_tmp = eqnAMatrix[ind + 0 * abl2],
@ -2705,7 +2706,7 @@ inline void gcode_G28() {
for (int yy = auto_bed_leveling_grid_points - 1; yy >= 0; yy--) {
for (int xx = 0; xx < auto_bed_leveling_grid_points; xx++) {
int ind = yy * auto_bed_leveling_grid_points + xx;
int ind = indexIntoAB[xx][yy];
float x_tmp = eqnAMatrix[ind + 0 * abl2],
y_tmp = eqnAMatrix[ind + 1 * abl2],
z_tmp = 0;

Loading…
Cancel
Save