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

@ -1460,7 +1460,7 @@ void MarlinUI::draw_status_screen() {
* Print Z values
*/
_ZLABEL(_LCD_W_POS, 1);
if (!ISNAN(ubl.z_values[x_plot][y_plot]))
if (!isnan(ubl.z_values[x_plot][y_plot]))
lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
else
lcd_put_u8str_P(PSTR(" -----"));
@ -1479,7 +1479,7 @@ void MarlinUI::draw_status_screen() {
* Show the location value
*/
_ZLABEL(_LCD_W_POS, 3);
if (!ISNAN(ubl.z_values[x_plot][y_plot]))
if (!isnan(ubl.z_values[x_plot][y_plot]))
lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
else
lcd_put_u8str_P(PSTR(" -----"));

View File

@ -943,7 +943,7 @@ void MarlinUI::draw_status_screen() {
// Show the location value
lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str_P(PSTR("Z:"));
if (!ISNAN(ubl.z_values[x_plot][y_plot]))
if (!isnan(ubl.z_values[x_plot][y_plot]))
lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
else
lcd_put_u8str_P(PSTR(" -----"));

View File

@ -569,7 +569,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
// Show the location value
lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);
if (!ISNAN(ubl.z_values[x_plot][y_plot]))
if (!isnan(ubl.z_values[x_plot][y_plot]))
lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
else
lcd_put_u8str_P(PSTR(" -----"));

View File

@ -32,7 +32,7 @@
namespace FTDI {
void draw_adjuster_value(CommandProcessor& cmd, int16_t x, int16_t y, int16_t w, int16_t h, float value, progmem_str units, int8_t width, uint8_t precision) {
char str[width + precision + 10 + (units ? strlen_P((const char*) units) : 0)];
if (ISNAN(value))
if (isnan(value))
strcpy_P(str, PSTR("-"));
else
dtostrf(value, width, precision, str);

View File

@ -31,7 +31,7 @@ void BedMeshBase::_drawMesh(CommandProcessor &cmd, int16_t x, int16_t y, int16_t
constexpr uint8_t cols = GRID_MAX_POINTS_X;
#define VALUE(X,Y) (func ? func(X,Y,data) : 0)
#define ISVAL(X,Y) (func ? !ISNAN(VALUE(X,Y)) : true)
#define ISVAL(X,Y) (func ? !isnan(VALUE(X,Y)) : true)
#define HEIGHT(X,Y) (ISVAL(X,Y) ? (VALUE(X,Y) - val_min) * scale_z : 0)
// Compute the mean, min and max for the points

View File

@ -79,7 +79,7 @@ void BedMeshEditScreen::onExit() {
float BedMeshEditScreen::getHighlightedValue() {
const float val = ExtUI::getMeshPoint(mydata.highlight);
return (ISNAN(val) ? 0 : val) + mydata.zAdjustment;
return (isnan(val) ? 0 : val) + mydata.zAdjustment;
}
void BedMeshEditScreen::setHighlightedValue(float value) {

View File

@ -421,7 +421,7 @@ namespace ExtUI {
#if AXIS_IS_TMC(Z2)
case Z2: return stepperZ2.getMilliamps();
#endif
default: return MFNAN;
default: return NAN;
};
}
@ -451,7 +451,7 @@ namespace ExtUI {
#if AXIS_IS_TMC(E7)
case E7: return stepperE7.getMilliamps();
#endif
default: return MFNAN;
default: return NAN;
};
}

View File

@ -54,7 +54,7 @@ static bool probe_single_point() {
z_measured[tram_index] = z_probed_height;
move_to_tramming_wait_pos();
return !ISNAN(z_probed_height);
return !isnan(z_probed_height);
}
static void _menu_single_probe(const uint8_t point) {

View File

@ -505,7 +505,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const
tft.set_background(COLOR_BACKGROUND);
tft_string.set(Z_LBL);
tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.trim();
tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);

View File

@ -492,7 +492,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const
tft.set_background(COLOR_BACKGROUND);
tft_string.set(Z_LBL);
tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.trim();
tft.add_text(96 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);

View File

@ -492,7 +492,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const
tft.set_background(COLOR_BACKGROUND);
tft_string.set(Z_LBL);
tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
tft_string.trim();
tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);