Simpler Allen Key config. Fixes, cleanups from refactor (#15256)
This commit is contained in:
@ -384,8 +384,8 @@ bool L6470_Marlin::get_user_input(uint8_t &driver_count, uint8_t axis_index[3],
|
||||
} break;
|
||||
|
||||
case 'Z': {
|
||||
position_min = center[E_AXIS] - displacement;
|
||||
position_max = center[E_AXIS] + displacement;
|
||||
position_min = center[Z_AXIS] - displacement;
|
||||
position_max = center[Z_AXIS] + displacement;
|
||||
echo_min_max('Z', position_min, position_max);
|
||||
if (false
|
||||
#ifdef Z_MIN_POS
|
||||
|
@ -51,18 +51,19 @@ void inline incremental_LSF_reset(struct linear_fit_data *lsf) {
|
||||
void inline incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) {
|
||||
// weight each accumulator by factor w, including the "number" of samples
|
||||
// (analogous to calling inc_LSF twice with same values to weight it by 2X)
|
||||
lsf->xbar += w * x;
|
||||
lsf->ybar += w * y;
|
||||
lsf->zbar += w * z;
|
||||
lsf->x2bar += w * x * x; // don't use sq(x) -- let compiler re-use w*x four times
|
||||
lsf->y2bar += w * y * y;
|
||||
lsf->z2bar += w * z * z;
|
||||
lsf->xybar += w * x * y;
|
||||
lsf->xzbar += w * x * z;
|
||||
lsf->yzbar += w * y * z;
|
||||
const float wx = w * x, wy = w * y, wz = w * z;
|
||||
lsf->xbar += wx;
|
||||
lsf->ybar += wy;
|
||||
lsf->zbar += wz;
|
||||
lsf->x2bar += wx * x;
|
||||
lsf->y2bar += wy * y;
|
||||
lsf->z2bar += wz * z;
|
||||
lsf->xybar += wx * y;
|
||||
lsf->xzbar += wx * z;
|
||||
lsf->yzbar += wy * z;
|
||||
lsf->N += w;
|
||||
lsf->max_absx = _MAX(ABS(w * x), lsf->max_absx);
|
||||
lsf->max_absy = _MAX(ABS(w * y), lsf->max_absy);
|
||||
lsf->max_absx = _MAX(ABS(wx), lsf->max_absx);
|
||||
lsf->max_absy = _MAX(ABS(wy), lsf->max_absy);
|
||||
}
|
||||
|
||||
void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) {
|
||||
|
@ -175,16 +175,9 @@ Nozzle nozzle;
|
||||
if (!TEST(cleans, Z_AXIS)) start.z = end.z = current_position[Z_AXIS];
|
||||
|
||||
switch (pattern) {
|
||||
case 1:
|
||||
zigzag(start, end, strokes, objects);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
circle(start, end, strokes, radius);
|
||||
break;
|
||||
|
||||
default:
|
||||
stroke(start, end, strokes);
|
||||
case 1: zigzag(start, end, strokes, objects); break;
|
||||
case 2: circle(start, end, strokes, radius); break;
|
||||
default: stroke(start, end, strokes);
|
||||
}
|
||||
}
|
||||
|
||||
@ -193,8 +186,7 @@ Nozzle nozzle;
|
||||
#if ENABLED(NOZZLE_PARK_FEATURE)
|
||||
|
||||
void Nozzle::park(const uint8_t z_action, const point_t &park/*=NOZZLE_PARK_POINT*/) {
|
||||
const float fr_xy = NOZZLE_PARK_XY_FEEDRATE,
|
||||
fr_z = NOZZLE_PARK_Z_FEEDRATE;
|
||||
constexpr float fr_xy = NOZZLE_PARK_XY_FEEDRATE, fr_z = NOZZLE_PARK_Z_FEEDRATE;
|
||||
|
||||
switch (z_action) {
|
||||
case 1: // Go to Z-park height
|
||||
|
@ -21,6 +21,8 @@
|
||||
*/
|
||||
|
||||
#include "numtostr.h"
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
#include "../core/utility.h"
|
||||
|
||||
char conv[8] = { 0 };
|
||||
@ -183,7 +185,7 @@ char* ftostr52(const float &f) {
|
||||
return &conv[3];
|
||||
}
|
||||
|
||||
#endif // LCD_DECIMAL_SMALL_XY
|
||||
#endif
|
||||
|
||||
// Convert float to fixed-length string with +123.4 / -123.4 format
|
||||
char* ftostr41sign(const float &f) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
#include <stdint.h>
|
||||
|
||||
// Convert a full-range unsigned 8bit int to a percentage
|
||||
char* ui8tostr4pct(const uint8_t i);
|
||||
@ -83,9 +83,13 @@ char* ftostr52sign(const float &x);
|
||||
// Convert unsigned float to string with 1234.5 format omitting trailing zeros
|
||||
char* ftostr51rj(const float &x);
|
||||
|
||||
#include "../core/macros.h"
|
||||
|
||||
// Convert float to rj string with 123 or -12 format
|
||||
FORCE_INLINE char* ftostr3(const float &x) { return i16tostr3(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
|
||||
|
||||
#include "../inc/MarlinConfigPre.h"
|
||||
|
||||
#if ENABLED(LCD_DECIMAL_SMALL_XY)
|
||||
// Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
|
||||
char* ftostr4sign(const float &fx);
|
||||
|
@ -25,7 +25,9 @@
|
||||
//#define DEBUG_STOPWATCH
|
||||
|
||||
#include "../core/macros.h" // for FORCE_INLINE
|
||||
#include "../core/millis_t.h"
|
||||
|
||||
#include <stdint.h>
|
||||
typedef uint32_t millis_t;
|
||||
|
||||
/**
|
||||
* @brief Stopwatch class
|
||||
|
@ -57,8 +57,11 @@ vector_3 vector_3::cross(const vector_3 &left, const vector_3 &right) {
|
||||
left.x * right.y - left.y * right.x);
|
||||
}
|
||||
|
||||
vector_3 vector_3::operator+(const vector_3 &v) { return vector_3((x + v.x), (y + v.y), (z + v.z)); }
|
||||
vector_3 vector_3::operator-(const vector_3 &v) { return vector_3((x - v.x), (y - v.y), (z - v.z)); }
|
||||
vector_3 vector_3::operator+(const vector_3 &v) { return vector_3(x + v.x, y + v.y, z + v.z); }
|
||||
vector_3 vector_3::operator-(const vector_3 &v) { return vector_3(x - v.x, y - v.y, z - v.z); }
|
||||
|
||||
vector_3 vector_3::operator* (const float &v) { return vector_3(x * v, y * v, z * v); }
|
||||
vector_3& vector_3::operator*=(const float &v) { x *= v; y *= v; z *= v; return *this; }
|
||||
|
||||
vector_3 vector_3::get_normal() const {
|
||||
vector_3 normalized = vector_3(x, y, z);
|
||||
|
@ -52,6 +52,10 @@ struct vector_3 {
|
||||
|
||||
vector_3 operator+(const vector_3 &v);
|
||||
vector_3 operator-(const vector_3 &v);
|
||||
|
||||
vector_3 operator* (const float &v);
|
||||
vector_3& operator*=(const float &v);
|
||||
|
||||
void normalize();
|
||||
float get_length() const;
|
||||
vector_3 get_normal() const;
|
||||
|
Reference in New Issue
Block a user