Apply const float & more

master
Scott Lahteine 8 years ago
parent ad5638f78c
commit c99bd69889

@ -2355,7 +2355,7 @@ static void clean_up_after_endstop_or_probe_move() {
* - Raise to the BETWEEN height * - Raise to the BETWEEN height
* - Return the probed Z position * - Return the probed Z position
*/ */
float probe_pt(const float x, const float y, const bool stow/*=true*/, const int verbose_level/*=1*/) { float probe_pt(const float &x, const float &y, const bool stow/*=true*/, const int verbose_level/*=1*/) {
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) { if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR(">>> probe_pt(", x); SERIAL_ECHOPAIR(">>> probe_pt(", x);

@ -52,7 +52,7 @@ void inline incremental_LSF_reset(struct linear_fit_data *lsf) {
memset(lsf, 0, sizeof(linear_fit_data)); memset(lsf, 0, sizeof(linear_fit_data));
} }
void inline incremental_WLSF(struct linear_fit_data *lsf, float x, float y, float z, float w) { 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 // weight each accumulator by factor w, including the "number" of samples
// (analagous to calling inc_LSF twice with same values to weight it by 2X) // (analagous to calling inc_LSF twice with same values to weight it by 2X)
lsf->xbar += w * x; lsf->xbar += w * x;
@ -69,7 +69,7 @@ void inline incremental_WLSF(struct linear_fit_data *lsf, float x, float y, floa
lsf->max_absy = max(fabs(w * y), lsf->max_absy); lsf->max_absy = max(fabs(w * y), lsf->max_absy);
} }
void inline incremental_LSF(struct linear_fit_data *lsf, float x, float y, float z) { void inline incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) {
lsf->xbar += x; lsf->xbar += x;
lsf->ybar += y; lsf->ybar += y;
lsf->zbar += z; lsf->zbar += z;

@ -51,10 +51,10 @@
extern uint8_t code_value_byte(); extern uint8_t code_value_byte();
extern bool code_value_bool(); extern bool code_value_bool();
extern bool code_has_value(); extern bool code_has_value();
extern float probe_pt(float x, float y, bool, int); extern float probe_pt(const float &x, const float &y, bool, int);
extern bool set_probe_deployed(bool); extern bool set_probe_deployed(bool);
void smart_fill_mesh(); void smart_fill_mesh();
void smart_fill_wlsf(float); void smart_fill_wlsf(const float &);
float measure_business_card_thickness(float &in_height); float measure_business_card_thickness(float &in_height);
void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool); void manually_probe_remaining_mesh(const float&, const float&, const float&, const float&, const bool);
@ -541,8 +541,8 @@
// P3.12 100X distance weighting // P3.12 100X distance weighting
// P3.13 1000X distance weighting, approaches simple average of nearest points // P3.13 1000X distance weighting, approaches simple average of nearest points
const float weight_power = (cvf - 3.10) * 100.0; // 3.12345 -> 2.345 const float weight_power = (cvf - 3.10) * 100.0, // 3.12345 -> 2.345
const float weight_factor = weight_power ? pow( 10.0, weight_power ) : 0; weight_factor = weight_power ? pow(10.0, weight_power) : 0;
smart_fill_wlsf(weight_factor); smart_fill_wlsf(weight_factor);
} }
break; break;

Loading…
Cancel
Save