Revert experimental NAN patch

Hold changes from #21575 (24a095c) for more testing.
This commit is contained in:
Scott Lahteine
2021-04-16 02:43:59 -05:00
parent 32dba5e0c7
commit 528b9bd872
31 changed files with 104 additions and 109 deletions

View File

@ -212,7 +212,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
const xy_pos_t center{0};
z_pt[CEN] += calibration_probe(center, stow_after_each);
if (ISNAN(z_pt[CEN])) return false;
if (isnan(z_pt[CEN])) return false;
}
if (_7p_calibration) { // probe extra center points
@ -223,7 +223,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
r = dcr * 0.1;
const xy_pos_t vec = { cos(a), sin(a) };
z_pt[CEN] += calibration_probe(vec * r, stow_after_each);
if (ISNAN(z_pt[CEN])) return false;
if (isnan(z_pt[CEN])) return false;
}
z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
}
@ -248,7 +248,7 @@ static bool probe_calibration_points(float z_pt[NPP + 1], const int8_t probe_poi
interpol = FMOD(rad, 1);
const xy_pos_t vec = { cos(a), sin(a) };
const float z_temp = calibration_probe(vec * r, stow_after_each);
if (ISNAN(z_temp)) return false;
if (isnan(z_temp)) return false;
// split probe point to neighbouring calibration points
z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
z_pt[uint8_t(LROUND(rad - interpol)) % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90)));

View File

@ -229,7 +229,7 @@ void GcodeSuite::G34() {
// Probing sanity check is disabled, as it would trigger even in normal cases because
// current_position.z has been manually altered in the "dirty trick" above.
const float z_probed_height = probe.probe_at_point(z_stepper_align.xy[iprobe], raise_after, 0, true, false);
if (ISNAN(z_probed_height)) {
if (isnan(z_probed_height)) {
SERIAL_ECHOLNPGM("Probing failed");
LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
err_break = true;

View File

@ -113,7 +113,7 @@ void GcodeSuite::G76() {
auto g76_probe = [](const TempSensorID sid, uint16_t &targ, const xy_pos_t &nozpos) {
do_z_clearance(5.0); // Raise nozzle before probing
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
if (ISNAN(measured_z))
if (isnan(measured_z))
SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
else {
SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
@ -208,7 +208,7 @@ void GcodeSuite::G76() {
report_temps(next_temp_report);
const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
if (ISNAN(measured_z) || target_bed > BED_MAX_TARGET) break;
if (isnan(measured_z) || target_bed > BED_MAX_TARGET) break;
}
SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
@ -267,7 +267,7 @@ void GcodeSuite::G76() {
if (timeout) break;
const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
if (ISNAN(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
if (isnan(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
}
SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

View File

@ -134,7 +134,7 @@ void GcodeSuite::M48() {
// Move to the first point, deploy, and probe
const float t = probe.probe_at_point(test_position, raise_after, verbose_level);
bool probing_good = !ISNAN(t);
bool probing_good = !isnan(t);
if (probing_good) {
randomSeed(millis());
@ -219,7 +219,7 @@ void GcodeSuite::M48() {
const float pz = probe.probe_at_point(test_position, raise_after, 0);
// Break the loop if the probe fails
probing_good = !ISNAN(pz);
probing_good = !isnan(pz);
if (!probing_good) break;
// Store the new sample