Get rid of malloc() and free() (PR#2549)

Just the minimal changes to qr_solve.cpp and .h to get rid of malloc() and free().

Saves about 656 bytes of progmem (library-code)
and 22 bytes for static variables.

Should use exactly the same amount of stack as it did before on the heap.
This commit is contained in:
AnHardt authored and Richard Wackerbarth committed 2015-07-30 17:50:31 -05:00
1 parent f9195d114b
commit d03f037a92
3 files changed
+11 -30

No files matched your search

+2 -1
View File
@@ -2643,7 +2643,8 @@ inline void gcode_G28() {
#else // !DELTA
// solve lsq problem
double *plane_equation_coefficients = qr_solve(abl2, 3, eqnAMatrix, eqnBVector);
double plane_equation_coefficients[3];
qr_solve(plane_equation_coefficients, abl2, 3, eqnAMatrix, eqnBVector);
mean /= abl2;