|
@@ -90,31 +90,8 @@ void recalc_delta_settings() {
|
90
|
90
|
*
|
91
|
91
|
* - Disable the home_offset (M206) and/or position_shift (G92)
|
92
|
92
|
* features to remove up to 12 float additions.
|
93
|
|
- *
|
94
|
|
- * - Use a fast-inverse-sqrt function and add the reciprocal.
|
95
|
|
- * (see above)
|
96
|
93
|
*/
|
97
|
94
|
|
98
|
|
-#if ENABLED(DELTA_FAST_SQRT) && defined(__AVR__)
|
99
|
|
- /**
|
100
|
|
- * Fast inverse sqrt from Quake III Arena
|
101
|
|
- * See: https://en.wikipedia.org/wiki/Fast_inverse_square_root
|
102
|
|
- */
|
103
|
|
- float Q_rsqrt(float number) {
|
104
|
|
- long i;
|
105
|
|
- float x2, y;
|
106
|
|
- const float threehalfs = 1.5f;
|
107
|
|
- x2 = number * 0.5f;
|
108
|
|
- y = number;
|
109
|
|
- i = * ( long * ) &y; // evil floating point bit level hacking
|
110
|
|
- i = 0x5F3759DF - ( i >> 1 ); // what the f***?
|
111
|
|
- y = * ( float * ) &i;
|
112
|
|
- y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
|
113
|
|
- // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
|
114
|
|
- return y;
|
115
|
|
- }
|
116
|
|
-#endif
|
117
|
|
-
|
118
|
95
|
#define DELTA_DEBUG(VAR) do { \
|
119
|
96
|
SERIAL_ECHOPAIR("cartesian X:", VAR[X_AXIS]); \
|
120
|
97
|
SERIAL_ECHOPAIR(" Y:", VAR[Y_AXIS]); \
|