Replace double with float, optimize calculation
This commit is contained in:
@ -359,7 +359,7 @@ static float auto_tune_h() {
|
||||
float h_fac = 0.0;
|
||||
|
||||
h_fac = r_quot / (2.0 / 3.0);
|
||||
h_fac = 1.0 / h_fac; // (2/3)/CR
|
||||
h_fac = 1.0f / h_fac; // (2/3)/CR
|
||||
return h_fac;
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ void GcodeSuite::M48() {
|
||||
|
||||
setup_for_endstop_or_probe_move();
|
||||
|
||||
double mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples];
|
||||
float mean = 0.0, sigma = 0.0, min = 99999.9, max = -99999.9, sample_set[n_samples];
|
||||
|
||||
// Move to the first point, deploy, and probe
|
||||
const float t = probe_pt(X_probe_location, Y_probe_location, raise_after, verbose_level);
|
||||
@ -142,7 +142,7 @@ void GcodeSuite::M48() {
|
||||
}
|
||||
|
||||
for (uint8_t l = 0; l < n_legs - 1; l++) {
|
||||
double delta_angle;
|
||||
float delta_angle;
|
||||
|
||||
if (schizoid_flag)
|
||||
// The points of a 5 point star are 72 degrees apart. We need to
|
||||
@ -199,7 +199,7 @@ void GcodeSuite::M48() {
|
||||
/**
|
||||
* Get the current mean for the data points we have so far
|
||||
*/
|
||||
double sum = 0.0;
|
||||
float sum = 0.0;
|
||||
for (uint8_t j = 0; j <= n; j++) sum += sample_set[j];
|
||||
mean = sum / (n + 1);
|
||||
|
||||
|
Reference in New Issue
Block a user