Browse Source

Revert experimental NAN patch

Hold changes from #21575 (24a095c) for more testing.
Scott Lahteine 4 years ago
parent
commit
528b9bd872
31 changed files with 104 additions and 109 deletions
  1. 0
    3
      Marlin/src/core/macros.h
  2. 7
    7
      Marlin/src/feature/bedlevel/abl/abl.cpp
  3. 2
    2
      Marlin/src/feature/bedlevel/bedlevel.cpp
  4. 1
    3
      Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h
  5. 5
    5
      Marlin/src/feature/bedlevel/ubl/ubl.cpp
  6. 3
    3
      Marlin/src/feature/bedlevel/ubl/ubl.h
  7. 20
    20
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  8. 9
    9
      Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp
  9. 1
    1
      Marlin/src/gcode/bedlevel/G35.cpp
  10. 11
    11
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  11. 1
    1
      Marlin/src/gcode/bedlevel/ubl/M421.cpp
  12. 3
    3
      Marlin/src/gcode/calibrate/G33.cpp
  13. 1
    1
      Marlin/src/gcode/calibrate/G34_M422.cpp
  14. 3
    3
      Marlin/src/gcode/calibrate/G76_M192_M871.cpp
  15. 2
    2
      Marlin/src/gcode/calibrate/M48.cpp
  16. 1
    1
      Marlin/src/gcode/probe/G30.cpp
  17. 2
    2
      Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
  18. 1
    1
      Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
  19. 1
    1
      Marlin/src/lcd/dogm/marlinui_DOGM.cpp
  20. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/adjuster_widget.cpp
  21. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_base.cpp
  22. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_edit_screen.cpp
  23. 2
    2
      Marlin/src/lcd/extui/ui_api.cpp
  24. 1
    1
      Marlin/src/lcd/menu/menu_tramming.cpp
  25. 1
    1
      Marlin/src/lcd/tft/ui_1024x600.cpp
  26. 1
    1
      Marlin/src/lcd/tft/ui_320x240.cpp
  27. 1
    1
      Marlin/src/lcd/tft/ui_480x320.cpp
  28. 10
    10
      Marlin/src/module/probe.cpp
  29. 7
    7
      Marlin/src/module/settings.cpp
  30. 3
    3
      Marlin/src/module/temperature.h
  31. 1
    1
      platformio.ini

+ 0
- 3
Marlin/src/core/macros.h View File

112
 #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
112
 #define SIGN(a) ({__typeof__(a) _a = (a); (_a>0)-(_a<0);})
113
 #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
113
 #define IS_POWER_OF_2(x) ((x) && !((x) & ((x) - 1)))
114
 
114
 
115
-#define MFNAN 999999.0f
116
-#define ISNAN(V) ((V) == MFNAN)
117
-
118
 // Macros to constrain values
115
 // Macros to constrain values
119
 #ifdef __cplusplus
116
 #ifdef __cplusplus
120
 
117
 

+ 7
- 7
Marlin/src/feature/bedlevel/abl/abl.cpp View File

43
  * Extrapolate a single point from its neighbors
43
  * Extrapolate a single point from its neighbors
44
  */
44
  */
45
 static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) {
45
 static void extrapolate_one_point(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) {
46
-  if (!ISNAN(z_values[x][y])) return;
46
+  if (!isnan(z_values[x][y])) return;
47
   if (DEBUGGING(LEVELING)) {
47
   if (DEBUGGING(LEVELING)) {
48
     DEBUG_ECHOPGM("Extrapolate [");
48
     DEBUG_ECHOPGM("Extrapolate [");
49
     if (x < 10) DEBUG_CHAR(' ');
49
     if (x < 10) DEBUG_CHAR(' ');
63
         c1 = z_values[x1][y1], c2 = z_values[x2][y2];
63
         c1 = z_values[x1][y1], c2 = z_values[x2][y2];
64
 
64
 
65
   // Treat far unprobed points as zero, near as equal to far
65
   // Treat far unprobed points as zero, near as equal to far
66
-  if (ISNAN(a2)) a2 = 0.0;
67
-  if (ISNAN(a1)) a1 = a2;
68
-  if (ISNAN(b2)) b2 = 0.0;
69
-  if (ISNAN(b1)) b1 = b2;
70
-  if (ISNAN(c2)) c2 = 0.0;
71
-  if (ISNAN(c1)) c1 = c2;
66
+  if (isnan(a2)) a2 = 0.0;
67
+  if (isnan(a1)) a1 = a2;
68
+  if (isnan(b2)) b2 = 0.0;
69
+  if (isnan(b1)) b1 = b2;
70
+  if (isnan(c2)) c2 = 0.0;
71
+  if (isnan(c1)) c1 = c2;
72
 
72
 
73
   const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2;
73
   const float a = 2 * a1 - a2, b = 2 * b1 - b2, c = 2 * c1 - c2;
74
 
74
 

+ 2
- 2
Marlin/src/feature/bedlevel/bedlevel.cpp View File

132
       bilinear_start.reset();
132
       bilinear_start.reset();
133
       bilinear_grid_spacing.reset();
133
       bilinear_grid_spacing.reset();
134
       GRID_LOOP(x, y) {
134
       GRID_LOOP(x, y) {
135
-        z_values[x][y] = MFNAN;
135
+        z_values[x][y] = NAN;
136
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0));
136
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, 0));
137
       }
137
       }
138
     #elif ABL_PLANAR
138
     #elif ABL_PLANAR
177
       LOOP_L_N(x, sx) {
177
       LOOP_L_N(x, sx) {
178
         SERIAL_CHAR(' ');
178
         SERIAL_CHAR(' ');
179
         const float offset = fn(x, y);
179
         const float offset = fn(x, y);
180
-        if (!ISNAN(offset)) {
180
+        if (!isnan(offset)) {
181
           if (offset >= 0) SERIAL_CHAR('+');
181
           if (offset >= 0) SERIAL_CHAR('+');
182
           SERIAL_ECHO_F(offset, int(precision));
182
           SERIAL_ECHO_F(offset, int(precision));
183
         }
183
         }

+ 1
- 3
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h View File

97
   static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); }
97
   static inline xy_int8_t probe_indexes(const xy_pos_t &xy) { return probe_indexes(xy.x, xy.y); }
98
 
98
 
99
   static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
99
   static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
100
-    if (ISNAN(a0) || ISNAN(a1) || ISNAN(z1) || ISNAN(a2) || ISNAN(z2)) return MFNAN;
101
     const float delta_z = (z2 - z1) / (a2 - a1),
100
     const float delta_z = (z2 - z1) / (a2 - a1),
102
                 delta_a = a0 - a1;
101
                 delta_a = a0 - a1;
103
     return z1 + delta_a * delta_z;
102
     return z1 + delta_a * delta_z;
118
                 z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]),
117
                 z2 = calc_z0(pos.x, x1, z_values[ind.x][ind.y+1], x2, z_values[ind.x+1][ind.y+1]),
119
                 zf = calc_z0(pos.y, y1, z1, y2, z2);
118
                 zf = calc_z0(pos.y, y1, z1, y2, z2);
120
 
119
 
121
-
122
-    return ISNAN(zf) ? zf : z_offset + zf * factor;
120
+    return z_offset + zf * factor;
123
   }
121
   }
124
 
122
 
125
   #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
123
   #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)

+ 5
- 5
Marlin/src/feature/bedlevel/ubl/ubl.cpp View File

48
   if (!leveling_is_valid()) return;
48
   if (!leveling_is_valid()) return;
49
   SERIAL_ECHO_MSG("  G29 I999");
49
   SERIAL_ECHO_MSG("  G29 I999");
50
   GRID_LOOP(x, y)
50
   GRID_LOOP(x, y)
51
-    if (!ISNAN(z_values[x][y])) {
51
+    if (!isnan(z_values[x][y])) {
52
       SERIAL_ECHO_START();
52
       SERIAL_ECHO_START();
53
       SERIAL_ECHOPAIR("  M421 I", x, " J", y);
53
       SERIAL_ECHOPAIR("  M421 I", x, " J", y);
54
       SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4);
54
       SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z_values[x][y], 4);
99
 
99
 
100
 void unified_bed_leveling::invalidate() {
100
 void unified_bed_leveling::invalidate() {
101
   set_bed_leveling_enabled(false);
101
   set_bed_leveling_enabled(false);
102
-  set_all_mesh_points_to_value(MFNAN);
102
+  set_all_mesh_points_to_value(NAN);
103
 }
103
 }
104
 
104
 
105
 void unified_bed_leveling::set_all_mesh_points_to_value(const_float_t value) {
105
 void unified_bed_leveling::set_all_mesh_points_to_value(const_float_t value) {
116
 
116
 
117
   void unified_bed_leveling::set_store_from_mesh(const bed_mesh_t &in_values, mesh_store_t &stored_values) {
117
   void unified_bed_leveling::set_store_from_mesh(const bed_mesh_t &in_values, mesh_store_t &stored_values) {
118
     auto z_to_store = [](const_float_t z) {
118
     auto z_to_store = [](const_float_t z) {
119
-      if (ISNAN(z)) return Z_STEPS_NAN;
119
+      if (isnan(z)) return Z_STEPS_NAN;
120
       const int32_t z_scaled = TRUNC(z * mesh_store_scaling);
120
       const int32_t z_scaled = TRUNC(z * mesh_store_scaling);
121
       if (z_scaled == Z_STEPS_NAN || !WITHIN(z_scaled, INT16_MIN, INT16_MAX))
121
       if (z_scaled == Z_STEPS_NAN || !WITHIN(z_scaled, INT16_MIN, INT16_MAX))
122
         return Z_STEPS_NAN; // If Z is out of range, return our custom 'NaN'
122
         return Z_STEPS_NAN; // If Z is out of range, return our custom 'NaN'
127
 
127
 
128
   void unified_bed_leveling::set_mesh_from_store(const mesh_store_t &stored_values, bed_mesh_t &out_values) {
128
   void unified_bed_leveling::set_mesh_from_store(const mesh_store_t &stored_values, bed_mesh_t &out_values) {
129
     auto store_to_z = [](const int16_t z_scaled) {
129
     auto store_to_z = [](const int16_t z_scaled) {
130
-      return z_scaled == Z_STEPS_NAN ? MFNAN : z_scaled / mesh_store_scaling;
130
+      return z_scaled == Z_STEPS_NAN ? NAN : z_scaled / mesh_store_scaling;
131
     };
131
     };
132
     GRID_LOOP(x, y) out_values[x][y] = store_to_z(stored_values[x][y]);
132
     GRID_LOOP(x, y) out_values[x][y] = store_to_z(stored_values[x][y]);
133
   }
133
   }
211
       if (lcd) {
211
       if (lcd) {
212
         // TODO: Display on Graphical LCD
212
         // TODO: Display on Graphical LCD
213
       }
213
       }
214
-      else if (ISNAN(f))
214
+      else if (isnan(f))
215
         SERIAL_ECHOPGM_P(human ? PSTR("  .   ") : PSTR("NAN"));
215
         SERIAL_ECHOPGM_P(human ? PSTR("  .   ") : PSTR("NAN"));
216
       else if (human || csv) {
216
       else if (human || csv) {
217
         if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' ');  // Display sign also for positive numbers (' ' for 0)
217
         if (human && f >= 0.0) SERIAL_CHAR(f > 0 ? '+' : ' ');  // Display sign also for positive numbers (' ' for 0)

+ 3
- 3
Marlin/src/feature/bedlevel/ubl/ubl.h View File

196
   #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
196
   #ifdef UBL_Z_RAISE_WHEN_OFF_MESH
197
     #define _UBL_OUTER_Z_RAISE UBL_Z_RAISE_WHEN_OFF_MESH
197
     #define _UBL_OUTER_Z_RAISE UBL_Z_RAISE_WHEN_OFF_MESH
198
   #else
198
   #else
199
-    #define _UBL_OUTER_Z_RAISE MFNAN
199
+    #define _UBL_OUTER_Z_RAISE NAN
200
   #endif
200
   #endif
201
 
201
 
202
   /**
202
   /**
269
     const float z2 = calc_z0(rx0, mesh_index_to_xpos(cx), z_values[cx][my], mesh_index_to_xpos(cx + 1), z_values[mx][my]);
269
     const float z2 = calc_z0(rx0, mesh_index_to_xpos(cx), z_values[cx][my], mesh_index_to_xpos(cx + 1), z_values[mx][my]);
270
     float z0 = calc_z0(ry0, mesh_index_to_ypos(cy), z1, mesh_index_to_ypos(cy + 1), z2);
270
     float z0 = calc_z0(ry0, mesh_index_to_ypos(cy), z1, mesh_index_to_ypos(cy + 1), z2);
271
 
271
 
272
-    if (ISNAN(z0)) { // if part of the Mesh is undefined, it will show up as MFNAN
272
+    if (isnan(z0)) { // if part of the Mesh is undefined, it will show up as NAN
273
       z0 = 0.0;      // in ubl.z_values[][] and propagate through the
273
       z0 = 0.0;      // in ubl.z_values[][] and propagate through the
274
                      // calculations. If our correction is NAN, we throw it out
274
                      // calculations. If our correction is NAN, we throw it out
275
                      // because part of the Mesh is undefined and we don't have the
275
                      // because part of the Mesh is undefined and we don't have the
301
   #endif
301
   #endif
302
 
302
 
303
   static inline bool mesh_is_valid() {
303
   static inline bool mesh_is_valid() {
304
-    GRID_LOOP(x, y) if (ISNAN(z_values[x][y])) return false;
304
+    GRID_LOOP(x, y) if (isnan(z_values[x][y])) return false;
305
     return true;
305
     return true;
306
   }
306
   }
307
 
307
 

+ 20
- 20
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp View File

331
         // to invalidate the ENTIRE mesh, which can't be done with
331
         // to invalidate the ENTIRE mesh, which can't be done with
332
         // find_closest_mesh_point (which only returns REAL points).
332
         // find_closest_mesh_point (which only returns REAL points).
333
         if (closest.pos.x < 0) { invalidate_all = true; break; }
333
         if (closest.pos.x < 0) { invalidate_all = true; break; }
334
-        z_values[closest.pos.x][closest.pos.y] = MFNAN;
334
+        z_values[closest.pos.x][closest.pos.y] = NAN;
335
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(closest.pos, 0.0f));
335
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(closest.pos, 0.0f));
336
       }
336
       }
337
     }
337
     }
516
               if (cpos.x < 0) {
516
               if (cpos.x < 0) {
517
                 // No more REAL INVALID mesh points to populate, so we ASSUME
517
                 // No more REAL INVALID mesh points to populate, so we ASSUME
518
                 // user meant to populate ALL INVALID mesh points to value
518
                 // user meant to populate ALL INVALID mesh points to value
519
-                GRID_LOOP(x, y) if (ISNAN(z_values[x][y])) z_values[x][y] = param.C_constant;
519
+                GRID_LOOP(x, y) if (isnan(z_values[x][y])) z_values[x][y] = param.C_constant;
520
                 break; // No more invalid Mesh Points to populate
520
                 break; // No more invalid Mesh Points to populate
521
               }
521
               }
522
               else {
522
               else {
675
   float sum = 0;
675
   float sum = 0;
676
   int n = 0;
676
   int n = 0;
677
   GRID_LOOP(x, y)
677
   GRID_LOOP(x, y)
678
-    if (!ISNAN(z_values[x][y])) {
678
+    if (!isnan(z_values[x][y])) {
679
       sum += z_values[x][y];
679
       sum += z_values[x][y];
680
       n++;
680
       n++;
681
     }
681
     }
687
   //
687
   //
688
   float sum_of_diff_squared = 0;
688
   float sum_of_diff_squared = 0;
689
   GRID_LOOP(x, y)
689
   GRID_LOOP(x, y)
690
-    if (!ISNAN(z_values[x][y]))
690
+    if (!isnan(z_values[x][y]))
691
       sum_of_diff_squared += sq(z_values[x][y] - mean);
691
       sum_of_diff_squared += sq(z_values[x][y] - mean);
692
 
692
 
693
   SERIAL_ECHOLNPAIR("# of samples: ", n);
693
   SERIAL_ECHOLNPAIR("# of samples: ", n);
698
 
698
 
699
   if (cflag)
699
   if (cflag)
700
     GRID_LOOP(x, y)
700
     GRID_LOOP(x, y)
701
-      if (!ISNAN(z_values[x][y])) {
701
+      if (!isnan(z_values[x][y])) {
702
         z_values[x][y] -= mean + offset;
702
         z_values[x][y] -= mean + offset;
703
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
703
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
704
       }
704
       }
709
  */
709
  */
710
 void unified_bed_leveling::shift_mesh_height() {
710
 void unified_bed_leveling::shift_mesh_height() {
711
   GRID_LOOP(x, y)
711
   GRID_LOOP(x, y)
712
-    if (!ISNAN(z_values[x][y])) {
712
+    if (!isnan(z_values[x][y])) {
713
       z_values[x][y] += param.C_constant;
713
       z_values[x][y] += param.C_constant;
714
       TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
714
       TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
715
     }
715
     }
1017
       ui.refresh();
1017
       ui.refresh();
1018
 
1018
 
1019
       float new_z = z_values[lpos.x][lpos.y];
1019
       float new_z = z_values[lpos.x][lpos.y];
1020
-      if (ISNAN(new_z)) new_z = 0;                        // Invalid points begin at 0
1020
+      if (isnan(new_z)) new_z = 0;                        // Invalid points begin at 0
1021
       new_z = FLOOR(new_z * 1000) * 0.001f;               // Chop off digits after the 1000ths place
1021
       new_z = FLOOR(new_z * 1000) * 0.001f;               // Chop off digits after the 1000ths place
1022
 
1022
 
1023
       ui.ubl_mesh_edit_start(new_z);
1023
       ui.ubl_mesh_edit_start(new_z);
1227
   mesh_index_pair farthest { -1, -1, -99999.99 };
1227
   mesh_index_pair farthest { -1, -1, -99999.99 };
1228
 
1228
 
1229
   GRID_LOOP(i, j) {
1229
   GRID_LOOP(i, j) {
1230
-    if (!ISNAN(z_values[i][j])) continue;  // Skip valid mesh points
1230
+    if (!isnan(z_values[i][j])) continue;  // Skip valid mesh points
1231
 
1231
 
1232
     // Skip unreachable points
1232
     // Skip unreachable points
1233
     if (!probe.can_reach(mesh_index_to_xpos(i), mesh_index_to_ypos(j)))
1233
     if (!probe.can_reach(mesh_index_to_xpos(i), mesh_index_to_ypos(j)))
1238
     xy_int8_t nearby { -1, -1 };
1238
     xy_int8_t nearby { -1, -1 };
1239
     float d1, d2 = 99999.9f;
1239
     float d1, d2 = 99999.9f;
1240
     GRID_LOOP(k, l) {
1240
     GRID_LOOP(k, l) {
1241
-      if (ISNAN(z_values[k][l])) continue;
1241
+      if (isnan(z_values[k][l])) continue;
1242
 
1242
 
1243
       found_a_real = true;
1243
       found_a_real = true;
1244
 
1244
 
1282
 
1282
 
1283
   static bool test_func(uint8_t i, uint8_t j, void *data) {
1283
   static bool test_func(uint8_t i, uint8_t j, void *data) {
1284
     find_closest_t *d = (find_closest_t*)data;
1284
     find_closest_t *d = (find_closest_t*)data;
1285
-    if ( (d->type == (ISNAN(ubl.z_values[i][j]) ? INVALID : REAL))
1285
+    if ( (d->type == (isnan(ubl.z_values[i][j]) ? INVALID : REAL))
1286
       || (d->type == SET_IN_BITMAP && !d->done_flags->marked(i, j))
1286
       || (d->type == SET_IN_BITMAP && !d->done_flags->marked(i, j))
1287
     ) {
1287
     ) {
1288
       // Found a Mesh Point of the specified type!
1288
       // Found a Mesh Point of the specified type!
1326
     float best_so_far = 99999.99f;
1326
     float best_so_far = 99999.99f;
1327
 
1327
 
1328
     GRID_LOOP(i, j) {
1328
     GRID_LOOP(i, j) {
1329
-      if ( (type == (ISNAN(z_values[i][j]) ? INVALID : REAL))
1329
+      if ( (type == (isnan(z_values[i][j]) ? INVALID : REAL))
1330
         || (type == SET_IN_BITMAP && !done_flags->marked(i, j))
1330
         || (type == SET_IN_BITMAP && !done_flags->marked(i, j))
1331
       ) {
1331
       ) {
1332
         // Found a Mesh Point of the specified type!
1332
         // Found a Mesh Point of the specified type!
1367
 
1367
 
1368
 bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) {
1368
 bool unified_bed_leveling::smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir) {
1369
   const float v = z_values[x][y];
1369
   const float v = z_values[x][y];
1370
-  if (ISNAN(v)) {                           // A NAN...
1370
+  if (isnan(v)) {                           // A NAN...
1371
     const int8_t dx = x + xdir, dy = y + ydir;
1371
     const int8_t dx = x + xdir, dy = y + ydir;
1372
     const float v1 = z_values[dx][dy];
1372
     const float v1 = z_values[dx][dy];
1373
-    if (!ISNAN(v1)) {                       // ...next to a pair of real values?
1373
+    if (!isnan(v1)) {                       // ...next to a pair of real values?
1374
       const float v2 = z_values[dx + xdir][dy + ydir];
1374
       const float v2 = z_values[dx + xdir][dy + ydir];
1375
-      if (!ISNAN(v2)) {
1375
+      if (!isnan(v2)) {
1376
         z_values[x][y] = v1 < v2 ? v1 : v1 + v1 - v2;
1376
         z_values[x][y] = v1 < v2 ? v1 : v1 + v1 - v2;
1377
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
1377
         TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, z_values[x][y]));
1378
         return true;
1378
         return true;
1441
       TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1441
       TERN_(HAS_STATUS_MESSAGE, ui.status_printf_P(0, PSTR(S_FMT " 1/3"), GET_TEXT(MSG_LCD_TILTING_MESH)));
1442
 
1442
 
1443
       measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
1443
       measured_z = probe.probe_at_point(points[0], PROBE_PT_RAISE, param.V_verbosity);
1444
-      if (ISNAN(measured_z))
1444
+      if (isnan(measured_z))
1445
         abort_flag = true;
1445
         abort_flag = true;
1446
       else {
1446
       else {
1447
         measured_z -= get_z_correction(points[0]);
1447
         measured_z -= get_z_correction(points[0]);
1463
         #ifdef VALIDATE_MESH_TILT
1463
         #ifdef VALIDATE_MESH_TILT
1464
           z2 = measured_z;
1464
           z2 = measured_z;
1465
         #endif
1465
         #endif
1466
-        if (ISNAN(measured_z))
1466
+        if (isnan(measured_z))
1467
           abort_flag = true;
1467
           abort_flag = true;
1468
         else {
1468
         else {
1469
           measured_z -= get_z_correction(points[1]);
1469
           measured_z -= get_z_correction(points[1]);
1483
         #ifdef VALIDATE_MESH_TILT
1483
         #ifdef VALIDATE_MESH_TILT
1484
           z3 = measured_z;
1484
           z3 = measured_z;
1485
         #endif
1485
         #endif
1486
-        if (ISNAN(measured_z))
1486
+        if (isnan(measured_z))
1487
           abort_flag = true;
1487
           abort_flag = true;
1488
         else {
1488
         else {
1489
           measured_z -= get_z_correction(points[2]);
1489
           measured_z -= get_z_correction(points[2]);
1522
 
1522
 
1523
             measured_z = probe.probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
1523
             measured_z = probe.probe_at_point(rpos, parser.seen('E') ? PROBE_PT_STOW : PROBE_PT_RAISE, param.V_verbosity); // TODO: Needs error handling
1524
 
1524
 
1525
-            abort_flag = ISNAN(measured_z);
1525
+            abort_flag = isnan(measured_z);
1526
 
1526
 
1527
             #if ENABLED(DEBUG_LEVELING_FEATURE)
1527
             #if ENABLED(DEBUG_LEVELING_FEATURE)
1528
               if (DEBUGGING(LEVELING)) {
1528
               if (DEBUGGING(LEVELING)) {
1673
 
1673
 
1674
     const float weight_scaled = weight_factor * _MAX(MESH_X_DIST, MESH_Y_DIST);
1674
     const float weight_scaled = weight_factor * _MAX(MESH_X_DIST, MESH_Y_DIST);
1675
 
1675
 
1676
-    GRID_LOOP(jx, jy) if (!ISNAN(z_values[jx][jy])) SBI(bitmap[jx], jy);
1676
+    GRID_LOOP(jx, jy) if (!isnan(z_values[jx][jy])) SBI(bitmap[jx], jy);
1677
 
1677
 
1678
     xy_pos_t ppos;
1678
     xy_pos_t ppos;
1679
     LOOP_L_N(ix, GRID_MAX_POINTS_X) {
1679
     LOOP_L_N(ix, GRID_MAX_POINTS_X) {
1680
       ppos.x = mesh_index_to_xpos(ix);
1680
       ppos.x = mesh_index_to_xpos(ix);
1681
       LOOP_L_N(iy, GRID_MAX_POINTS_Y) {
1681
       LOOP_L_N(iy, GRID_MAX_POINTS_Y) {
1682
         ppos.y = mesh_index_to_ypos(iy);
1682
         ppos.y = mesh_index_to_ypos(iy);
1683
-        if (ISNAN(z_values[ix][iy])) {
1683
+        if (isnan(z_values[ix][iy])) {
1684
           // undefined mesh point at (ppos.x,ppos.y), compute weighted LSF from original valid mesh points.
1684
           // undefined mesh point at (ppos.x,ppos.y), compute weighted LSF from original valid mesh points.
1685
           incremental_LSF_reset(&lsf_results);
1685
           incremental_LSF_reset(&lsf_results);
1686
           xy_pos_t rpos;
1686
           xy_pos_t rpos;

+ 9
- 9
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp View File

85
 
85
 
86
       // Undefined parts of the Mesh in z_values[][] are NAN.
86
       // Undefined parts of the Mesh in z_values[][] are NAN.
87
       // Replace NAN corrections with 0.0 to prevent NAN propagation.
87
       // Replace NAN corrections with 0.0 to prevent NAN propagation.
88
-      if (!ISNAN(z0)) end.z += z0;
88
+      if (!isnan(z0)) end.z += z0;
89
       planner.buffer_segment(end, scaled_fr_mm_s, extruder);
89
       planner.buffer_segment(end, scaled_fr_mm_s, extruder);
90
       current_position = destination;
90
       current_position = destination;
91
       return;
91
       return;
150
 
150
 
151
         // Undefined parts of the Mesh in z_values[][] are NAN.
151
         // Undefined parts of the Mesh in z_values[][] are NAN.
152
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
152
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
153
-        if (ISNAN(z0)) z0 = 0.0;
153
+        if (isnan(z0)) z0 = 0.0;
154
 
154
 
155
         const float ry = mesh_index_to_ypos(icell.y);
155
         const float ry = mesh_index_to_ypos(icell.y);
156
 
156
 
198
 
198
 
199
         // Undefined parts of the Mesh in z_values[][] are NAN.
199
         // Undefined parts of the Mesh in z_values[][] are NAN.
200
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
200
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
201
-        if (ISNAN(z0)) z0 = 0.0;
201
+        if (isnan(z0)) z0 = 0.0;
202
 
202
 
203
         /**
203
         /**
204
          * Without this check, it's possible to generate a zero length move, as in the case where
204
          * Without this check, it's possible to generate a zero length move, as in the case where
253
 
253
 
254
         // Undefined parts of the Mesh in z_values[][] are NAN.
254
         // Undefined parts of the Mesh in z_values[][] are NAN.
255
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
255
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
256
-        if (ISNAN(z0)) z0 = 0.0;
256
+        if (isnan(z0)) z0 = 0.0;
257
 
257
 
258
         if (!inf_normalized_flag) {
258
         if (!inf_normalized_flag) {
259
           on_axis_distance = use_x_dist ? rx - start.x : next_mesh_line_y - start.y;
259
           on_axis_distance = use_x_dist ? rx - start.x : next_mesh_line_y - start.y;
276
 
276
 
277
         // Undefined parts of the Mesh in z_values[][] are NAN.
277
         // Undefined parts of the Mesh in z_values[][] are NAN.
278
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
278
         // Replace NAN corrections with 0.0 to prevent NAN propagation.
279
-        if (ISNAN(z0)) z0 = 0.0;
279
+        if (isnan(z0)) z0 = 0.0;
280
 
280
 
281
         if (!inf_normalized_flag) {
281
         if (!inf_normalized_flag) {
282
           on_axis_distance = use_x_dist ? next_mesh_line_x - start.x : ry - start.y;
282
           on_axis_distance = use_x_dist ? next_mesh_line_x - start.x : ry - start.y;
405
             z_x0y1 = z_values[icell.x  ][icell.y+1],  // z at lower right corner
405
             z_x0y1 = z_values[icell.x  ][icell.y+1],  // z at lower right corner
406
             z_x1y1 = z_values[icell.x+1][icell.y+1];  // z at upper right corner
406
             z_x1y1 = z_values[icell.x+1][icell.y+1];  // z at upper right corner
407
 
407
 
408
-      if (ISNAN(z_x0y0)) z_x0y0 = 0;              // ideally activating planner.leveling_active (G29 A)
409
-      if (ISNAN(z_x1y0)) z_x1y0 = 0;              //   should refuse if any invalid mesh points
410
-      if (ISNAN(z_x0y1)) z_x0y1 = 0;              //   in order to avoid ISNAN tests per cell,
411
-      if (ISNAN(z_x1y1)) z_x1y1 = 0;              //   thus guessing zero for undefined points
408
+      if (isnan(z_x0y0)) z_x0y0 = 0;              // ideally activating planner.leveling_active (G29 A)
409
+      if (isnan(z_x1y0)) z_x1y0 = 0;              //   should refuse if any invalid mesh points
410
+      if (isnan(z_x0y1)) z_x0y1 = 0;              //   in order to avoid isnan tests per cell,
411
+      if (isnan(z_x1y1)) z_x1y1 = 0;              //   thus guessing zero for undefined points
412
 
412
 
413
       const xy_pos_t pos = { mesh_index_to_xpos(icell.x), mesh_index_to_ypos(icell.y) };
413
       const xy_pos_t pos = { mesh_index_to_xpos(icell.x), mesh_index_to_ypos(icell.y) };
414
       xy_pos_t cell = raw - pos;
414
       xy_pos_t cell = raw - pos;

+ 1
- 1
Marlin/src/gcode/bedlevel/G35.cpp View File

105
     do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7));
105
     do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, Z_CLEARANCE_BETWEEN_PROBES, 7));
106
     const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
106
     const float z_probed_height = probe.probe_at_point(screws_tilt_adjust_pos[i], PROBE_PT_RAISE, 0, true);
107
 
107
 
108
-    if (ISNAN(z_probed_height)) {
108
+    if (isnan(z_probed_height)) {
109
       SERIAL_ECHOPAIR("G35 failed at point ", i, " (");
109
       SERIAL_ECHOPAIR("G35 failed at point ", i, " (");
110
       SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
110
       SERIAL_ECHOPGM_P((char *)pgm_read_ptr(&tramming_point_name[i]));
111
       SERIAL_CHAR(')');
111
       SERIAL_CHAR(')');

+ 11
- 11
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

288
           G29_RETURN(false);
288
           G29_RETURN(false);
289
         }
289
         }
290
 
290
 
291
-        const float rx = RAW_X_POSITION(parser.linearval('X', MFNAN)),
292
-                    ry = RAW_Y_POSITION(parser.linearval('Y', MFNAN));
291
+        const float rx = RAW_X_POSITION(parser.linearval('X', NAN)),
292
+                    ry = RAW_Y_POSITION(parser.linearval('Y', NAN));
293
         int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
293
         int8_t i = parser.byteval('I', -1), j = parser.byteval('J', -1);
294
 
294
 
295
-        if (!ISNAN(rx) && !ISNAN(ry)) {
295
+        if (!isnan(rx) && !isnan(ry)) {
296
           // Get nearest i / j from rx / ry
296
           // Get nearest i / j from rx / ry
297
           i = (rx - bilinear_start.x + 0.5 * abl.gridSpacing.x) / abl.gridSpacing.x;
297
           i = (rx - bilinear_start.x + 0.5 * abl.gridSpacing.x) / abl.gridSpacing.x;
298
           j = (ry - bilinear_start.y + 0.5 * abl.gridSpacing.y) / abl.gridSpacing.y;
298
           j = (ry - bilinear_start.y + 0.5 * abl.gridSpacing.y) / abl.gridSpacing.y;
609
 
609
 
610
       // Outer loop is X with PROBE_Y_FIRST enabled
610
       // Outer loop is X with PROBE_Y_FIRST enabled
611
       // Outer loop is Y with PROBE_Y_FIRST disabled
611
       // Outer loop is Y with PROBE_Y_FIRST disabled
612
-      for (PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_SIZE && !ISNAN(abl.measured_z); PR_OUTER_VAR++) {
612
+      for (PR_OUTER_VAR = 0; PR_OUTER_VAR < PR_OUTER_SIZE && !isnan(abl.measured_z); PR_OUTER_VAR++) {
613
 
613
 
614
         int8_t inStart, inStop, inInc;
614
         int8_t inStart, inStop, inInc;
615
 
615
 
645
 
645
 
646
           abl.measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
646
           abl.measured_z = faux ? 0.001f * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
647
 
647
 
648
-          if (ISNAN(abl.measured_z)) {
648
+          if (isnan(abl.measured_z)) {
649
             set_bed_leveling_enabled(abl.reenable);
649
             set_bed_leveling_enabled(abl.reenable);
650
             break; // Breaks out of both loops
650
             break; // Breaks out of both loops
651
           }
651
           }
691
         // Retain the last probe position
691
         // Retain the last probe position
692
         abl.probePos = points[i];
692
         abl.probePos = points[i];
693
         abl.measured_z = faux ? 0.001 * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
693
         abl.measured_z = faux ? 0.001 * random(-100, 101) : probe.probe_at_point(abl.probePos, raise_after, abl.verbose_level);
694
-        if (ISNAN(abl.measured_z)) {
694
+        if (isnan(abl.measured_z)) {
695
           set_bed_leveling_enabled(abl.reenable);
695
           set_bed_leveling_enabled(abl.reenable);
696
           break;
696
           break;
697
         }
697
         }
698
         points[i].z = abl.measured_z;
698
         points[i].z = abl.measured_z;
699
       }
699
       }
700
 
700
 
701
-      if (!abl.dryrun && !ISNAN(abl.measured_z)) {
701
+      if (!abl.dryrun && !isnan(abl.measured_z)) {
702
         vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal();
702
         vector_3 planeNormal = vector_3::cross(points[0] - points[1], points[2] - points[1]).get_normal();
703
         if (planeNormal.z < 0) planeNormal *= -1;
703
         if (planeNormal.z < 0) planeNormal *= -1;
704
         planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
704
         planner.bed_level_matrix = matrix_3x3::create_look_at(planeNormal);
714
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
714
     // Stow the probe. No raise for FIX_MOUNTED_PROBE.
715
     if (probe.stow()) {
715
     if (probe.stow()) {
716
       set_bed_leveling_enabled(abl.reenable);
716
       set_bed_leveling_enabled(abl.reenable);
717
-      abl.measured_z = MFNAN;
717
+      abl.measured_z = NAN;
718
     }
718
     }
719
   }
719
   }
720
   #endif // !PROBE_MANUALLY
720
   #endif // !PROBE_MANUALLY
737
   #endif
737
   #endif
738
 
738
 
739
   // Calculate leveling, print reports, correct the position
739
   // Calculate leveling, print reports, correct the position
740
-  if (!ISNAN(abl.measured_z)) {
740
+  if (!isnan(abl.measured_z)) {
741
     #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
741
     #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
742
 
742
 
743
       if (!abl.dryrun) extrapolate_unprobed_bed_level();
743
       if (!abl.dryrun) extrapolate_unprobed_bed_level();
874
 
874
 
875
     // Auto Bed Leveling is complete! Enable if possible.
875
     // Auto Bed Leveling is complete! Enable if possible.
876
     planner.leveling_active = !abl.dryrun || abl.reenable;
876
     planner.leveling_active = !abl.dryrun || abl.reenable;
877
-  } // !ISNAN(abl.measured_z)
877
+  } // !isnan(abl.measured_z)
878
 
878
 
879
   // Restore state after probing
879
   // Restore state after probing
880
   if (!faux) restore_feedrate_and_scaling();
880
   if (!faux) restore_feedrate_and_scaling();
900
 
900
 
901
   TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
901
   TERN_(FULL_REPORT_TO_HOST_FEATURE, set_and_report_grblstate(M_IDLE));
902
 
902
 
903
-  G29_RETURN(ISNAN(abl.measured_z));
903
+  G29_RETURN(isnan(abl.measured_z));
904
 }
904
 }
905
 
905
 
906
 #endif // HAS_ABL_NOT_UBL
906
 #endif // HAS_ABL_NOT_UBL

+ 1
- 1
Marlin/src/gcode/bedlevel/ubl/M421.cpp View File

62
     SERIAL_ERROR_MSG(STR_ERR_MESH_XY);
62
     SERIAL_ERROR_MSG(STR_ERR_MESH_XY);
63
   else {
63
   else {
64
     float &zval = ubl.z_values[ij.x][ij.y];
64
     float &zval = ubl.z_values[ij.x][ij.y];
65
-    zval = hasN ? MFNAN : parser.value_linear_units() + (hasQ ? zval : 0);
65
+    zval = hasN ? NAN : parser.value_linear_units() + (hasQ ? zval : 0);
66
     TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval));
66
     TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(ij.x, ij.y, zval));
67
   }
67
   }
68
 }
68
 }

+ 3
- 3
Marlin/src/gcode/calibrate/G33.cpp View File

212
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
212
     if (!_7p_no_intermediates && !_7p_4_intermediates && !_7p_11_intermediates) { // probe the center
213
       const xy_pos_t center{0};
213
       const xy_pos_t center{0};
214
       z_pt[CEN] += calibration_probe(center, stow_after_each);
214
       z_pt[CEN] += calibration_probe(center, stow_after_each);
215
-      if (ISNAN(z_pt[CEN])) return false;
215
+      if (isnan(z_pt[CEN])) return false;
216
     }
216
     }
217
 
217
 
218
     if (_7p_calibration) { // probe extra center points
218
     if (_7p_calibration) { // probe extra center points
223
                     r = dcr * 0.1;
223
                     r = dcr * 0.1;
224
         const xy_pos_t vec = { cos(a), sin(a) };
224
         const xy_pos_t vec = { cos(a), sin(a) };
225
         z_pt[CEN] += calibration_probe(vec * r, stow_after_each);
225
         z_pt[CEN] += calibration_probe(vec * r, stow_after_each);
226
-        if (ISNAN(z_pt[CEN])) return false;
226
+        if (isnan(z_pt[CEN])) return false;
227
      }
227
      }
228
       z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
228
       z_pt[CEN] /= float(_7p_2_intermediates ? 7 : probe_points);
229
     }
229
     }
248
                       interpol = FMOD(rad, 1);
248
                       interpol = FMOD(rad, 1);
249
           const xy_pos_t vec = { cos(a), sin(a) };
249
           const xy_pos_t vec = { cos(a), sin(a) };
250
           const float z_temp = calibration_probe(vec * r, stow_after_each);
250
           const float z_temp = calibration_probe(vec * r, stow_after_each);
251
-          if (ISNAN(z_temp)) return false;
251
+          if (isnan(z_temp)) return false;
252
           // split probe point to neighbouring calibration points
252
           // split probe point to neighbouring calibration points
253
           z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
253
           z_pt[uint8_t(LROUND(rad - interpol + NPP - 1)) % NPP + 1] += z_temp * sq(cos(RADIANS(interpol * 90)));
254
           z_pt[uint8_t(LROUND(rad - interpol))           % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90)));
254
           z_pt[uint8_t(LROUND(rad - interpol))           % NPP + 1] += z_temp * sq(sin(RADIANS(interpol * 90)));

+ 1
- 1
Marlin/src/gcode/calibrate/G34_M422.cpp View File

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

+ 3
- 3
Marlin/src/gcode/calibrate/G76_M192_M871.cpp View File

113
   auto g76_probe = [](const TempSensorID sid, uint16_t &targ, const xy_pos_t &nozpos) {
113
   auto g76_probe = [](const TempSensorID sid, uint16_t &targ, const xy_pos_t &nozpos) {
114
     do_z_clearance(5.0); // Raise nozzle before probing
114
     do_z_clearance(5.0); // Raise nozzle before probing
115
     const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false);  // verbose=0, probe_relative=false
115
     const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false);  // verbose=0, probe_relative=false
116
-    if (ISNAN(measured_z))
116
+    if (isnan(measured_z))
117
       SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
117
       SERIAL_ECHOLNPGM("!Received NAN. Aborting.");
118
     else {
118
     else {
119
       SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
119
       SERIAL_ECHOLNPAIR_F("Measured: ", measured_z);
208
         report_temps(next_temp_report);
208
         report_temps(next_temp_report);
209
 
209
 
210
       const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
210
       const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
211
-      if (ISNAN(measured_z) || target_bed > BED_MAX_TARGET) break;
211
+      if (isnan(measured_z) || target_bed > BED_MAX_TARGET) break;
212
     }
212
     }
213
 
213
 
214
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
214
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
267
       if (timeout) break;
267
       if (timeout) break;
268
 
268
 
269
       const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
269
       const float measured_z = g76_probe(TSI_PROBE, target_probe, noz_pos_xyz);
270
-      if (ISNAN(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
270
+      if (isnan(measured_z) || target_probe > cali_info_init[TSI_PROBE].end_temp) break;
271
     }
271
     }
272
 
272
 
273
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());
273
     SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

+ 2
- 2
Marlin/src/gcode/calibrate/M48.cpp View File

134
 
134
 
135
   // Move to the first point, deploy, and probe
135
   // Move to the first point, deploy, and probe
136
   const float t = probe.probe_at_point(test_position, raise_after, verbose_level);
136
   const float t = probe.probe_at_point(test_position, raise_after, verbose_level);
137
-  bool probing_good = !ISNAN(t);
137
+  bool probing_good = !isnan(t);
138
 
138
 
139
   if (probing_good) {
139
   if (probing_good) {
140
     randomSeed(millis());
140
     randomSeed(millis());
219
       const float pz = probe.probe_at_point(test_position, raise_after, 0);
219
       const float pz = probe.probe_at_point(test_position, raise_after, 0);
220
 
220
 
221
       // Break the loop if the probe fails
221
       // Break the loop if the probe fails
222
-      probing_good = !ISNAN(pz);
222
+      probing_good = !isnan(pz);
223
       if (!probing_good) break;
223
       if (!probing_good) break;
224
 
224
 
225
       // Store the new sample
225
       // Store the new sample

+ 1
- 1
Marlin/src/gcode/probe/G30.cpp View File

52
 
52
 
53
   const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
53
   const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
54
   const float measured_z = probe.probe_at_point(pos, raise_after, 1);
54
   const float measured_z = probe.probe_at_point(pos, raise_after, 1);
55
-  if (!ISNAN(measured_z))
55
+  if (!isnan(measured_z))
56
     SERIAL_ECHOLNPAIR("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
56
     SERIAL_ECHOLNPAIR("Bed X: ", pos.x, " Y: ", pos.y, " Z: ", measured_z);
57
 
57
 
58
   restore_feedrate_and_scaling();
58
   restore_feedrate_and_scaling();

+ 2
- 2
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp View File

1460
          * Print Z values
1460
          * Print Z values
1461
          */
1461
          */
1462
         _ZLABEL(_LCD_W_POS, 1);
1462
         _ZLABEL(_LCD_W_POS, 1);
1463
-        if (!ISNAN(ubl.z_values[x_plot][y_plot]))
1463
+        if (!isnan(ubl.z_values[x_plot][y_plot]))
1464
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1464
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1465
         else
1465
         else
1466
           lcd_put_u8str_P(PSTR(" -----"));
1466
           lcd_put_u8str_P(PSTR(" -----"));
1479
          * Show the location value
1479
          * Show the location value
1480
          */
1480
          */
1481
         _ZLABEL(_LCD_W_POS, 3);
1481
         _ZLABEL(_LCD_W_POS, 3);
1482
-        if (!ISNAN(ubl.z_values[x_plot][y_plot]))
1482
+        if (!isnan(ubl.z_values[x_plot][y_plot]))
1483
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1483
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
1484
         else
1484
         else
1485
           lcd_put_u8str_P(PSTR(" -----"));
1485
           lcd_put_u8str_P(PSTR(" -----"));

+ 1
- 1
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp View File

943
       // Show the location value
943
       // Show the location value
944
       lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str_P(PSTR("Z:"));
944
       lcd.setCursor(_LCD_W_POS, 3); lcd_put_u8str_P(PSTR("Z:"));
945
 
945
 
946
-      if (!ISNAN(ubl.z_values[x_plot][y_plot]))
946
+      if (!isnan(ubl.z_values[x_plot][y_plot]))
947
         lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
947
         lcd.print(ftostr43sign(ubl.z_values[x_plot][y_plot]));
948
       else
948
       else
949
         lcd_put_u8str_P(PSTR(" -----"));
949
         lcd_put_u8str_P(PSTR(" -----"));

+ 1
- 1
Marlin/src/lcd/dogm/marlinui_DOGM.cpp View File

569
 
569
 
570
         // Show the location value
570
         // Show the location value
571
         lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);
571
         lcd_put_u8str_P(74, LCD_PIXEL_HEIGHT, Z_LBL);
572
-        if (!ISNAN(ubl.z_values[x_plot][y_plot]))
572
+        if (!isnan(ubl.z_values[x_plot][y_plot]))
573
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
573
           lcd_put_u8str(ftostr43sign(ubl.z_values[x_plot][y_plot]));
574
         else
574
         else
575
           lcd_put_u8str_P(PSTR(" -----"));
575
           lcd_put_u8str_P(PSTR(" -----"));

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/adjuster_widget.cpp View File

32
 namespace FTDI {
32
 namespace FTDI {
33
   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) {
33
   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) {
34
     char str[width + precision + 10 + (units ? strlen_P((const char*) units) : 0)];
34
     char str[width + precision + 10 + (units ? strlen_P((const char*) units) : 0)];
35
-    if (ISNAN(value))
35
+    if (isnan(value))
36
       strcpy_P(str, PSTR("-"));
36
       strcpy_P(str, PSTR("-"));
37
     else
37
     else
38
       dtostrf(value, width, precision, str);
38
       dtostrf(value, width, precision, str);

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_base.cpp View File

31
   constexpr uint8_t cols = GRID_MAX_POINTS_X;
31
   constexpr uint8_t cols = GRID_MAX_POINTS_X;
32
 
32
 
33
   #define VALUE(X,Y)  (func ? func(X,Y,data) : 0)
33
   #define VALUE(X,Y)  (func ? func(X,Y,data) : 0)
34
-  #define ISVAL(X,Y)  (func ? !ISNAN(VALUE(X,Y)) : true)
34
+  #define ISVAL(X,Y)  (func ? !isnan(VALUE(X,Y)) : true)
35
   #define HEIGHT(X,Y) (ISVAL(X,Y) ? (VALUE(X,Y) - val_min) * scale_z : 0)
35
   #define HEIGHT(X,Y) (ISVAL(X,Y) ? (VALUE(X,Y) - val_min) * scale_z : 0)
36
 
36
 
37
   // Compute the mean, min and max for the points
37
   // Compute the mean, min and max for the points

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/screens/bed_mesh_edit_screen.cpp View File

79
 
79
 
80
 float BedMeshEditScreen::getHighlightedValue() {
80
 float BedMeshEditScreen::getHighlightedValue() {
81
   const float val = ExtUI::getMeshPoint(mydata.highlight);
81
   const float val = ExtUI::getMeshPoint(mydata.highlight);
82
-  return (ISNAN(val) ? 0 : val) + mydata.zAdjustment;
82
+  return (isnan(val) ? 0 : val) + mydata.zAdjustment;
83
 }
83
 }
84
 
84
 
85
 void BedMeshEditScreen::setHighlightedValue(float value) {
85
 void BedMeshEditScreen::setHighlightedValue(float value) {

+ 2
- 2
Marlin/src/lcd/extui/ui_api.cpp View File

421
         #if AXIS_IS_TMC(Z2)
421
         #if AXIS_IS_TMC(Z2)
422
           case Z2: return stepperZ2.getMilliamps();
422
           case Z2: return stepperZ2.getMilliamps();
423
         #endif
423
         #endif
424
-        default: return MFNAN;
424
+        default: return NAN;
425
       };
425
       };
426
     }
426
     }
427
 
427
 
451
         #if AXIS_IS_TMC(E7)
451
         #if AXIS_IS_TMC(E7)
452
           case E7: return stepperE7.getMilliamps();
452
           case E7: return stepperE7.getMilliamps();
453
         #endif
453
         #endif
454
-        default: return MFNAN;
454
+        default: return NAN;
455
       };
455
       };
456
     }
456
     }
457
 
457
 

+ 1
- 1
Marlin/src/lcd/menu/menu_tramming.cpp View File

54
   z_measured[tram_index] = z_probed_height;
54
   z_measured[tram_index] = z_probed_height;
55
   move_to_tramming_wait_pos();
55
   move_to_tramming_wait_pos();
56
 
56
 
57
-  return !ISNAN(z_probed_height);
57
+  return !isnan(z_probed_height);
58
 }
58
 }
59
 
59
 
60
 static void _menu_single_probe(const uint8_t point) {
60
 static void _menu_single_probe(const uint8_t point) {

+ 1
- 1
Marlin/src/lcd/tft/ui_1024x600.cpp View File

505
     tft.set_background(COLOR_BACKGROUND);
505
     tft.set_background(COLOR_BACKGROUND);
506
     tft_string.set(Z_LBL);
506
     tft_string.set(Z_LBL);
507
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
507
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
508
-    tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
508
+    tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
509
     tft_string.trim();
509
     tft_string.trim();
510
     tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
510
     tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
511
 
511
 

+ 1
- 1
Marlin/src/lcd/tft/ui_320x240.cpp View File

492
     tft.set_background(COLOR_BACKGROUND);
492
     tft.set_background(COLOR_BACKGROUND);
493
     tft_string.set(Z_LBL);
493
     tft_string.set(Z_LBL);
494
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
494
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
495
-    tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
495
+    tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
496
     tft_string.trim();
496
     tft_string.trim();
497
     tft.add_text(96 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
497
     tft.add_text(96 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
498
 
498
 

+ 1
- 1
Marlin/src/lcd/tft/ui_480x320.cpp View File

492
     tft.set_background(COLOR_BACKGROUND);
492
     tft.set_background(COLOR_BACKGROUND);
493
     tft_string.set(Z_LBL);
493
     tft_string.set(Z_LBL);
494
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
494
     tft.add_text(0, MENU_TEXT_Y_OFFSET, COLOR_MENU_TEXT, tft_string);
495
-    tft_string.set(ISNAN(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
495
+    tft_string.set(isnan(ubl.z_values[x_plot][y_plot]) ? "-----" : ftostr43sign(ubl.z_values[x_plot][y_plot]));
496
     tft_string.trim();
496
     tft_string.trim();
497
     tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
497
     tft.add_text(120 - tft_string.width(), MENU_TEXT_Y_OFFSET, COLOR_MENU_VALUE, tft_string);
498
 
498
 

+ 10
- 10
Marlin/src/module/probe.cpp View File

583
  * @details Used by probe_at_point to get the bed Z height at the current XY.
583
  * @details Used by probe_at_point to get the bed Z height at the current XY.
584
  *          Leaves current_position.z at the height where the probe triggered.
584
  *          Leaves current_position.z at the height where the probe triggered.
585
  *
585
  *
586
- * @return The Z position of the bed at the current XY or MFNAN on error.
586
+ * @return The Z position of the bed at the current XY or NAN on error.
587
  */
587
  */
588
 float Probe::run_z_probe(const bool sanity_check/*=true*/) {
588
 float Probe::run_z_probe(const bool sanity_check/*=true*/) {
589
   DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING));
589
   DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING));
617
   #if TOTAL_PROBING == 2
617
   #if TOTAL_PROBING == 2
618
 
618
 
619
     // Attempt to tare the probe
619
     // Attempt to tare the probe
620
-    if (TERN0(PROBE_TARE, tare())) return MFNAN;
620
+    if (TERN0(PROBE_TARE, tare())) return NAN;
621
 
621
 
622
     // Do a first probe at the fast speed
622
     // Do a first probe at the fast speed
623
     if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s,
623
     if (try_to_probe(PSTR("FAST"), z_probe_low_point, z_probe_fast_mm_s,
624
-                     sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return MFNAN;
624
+                     sanity_check, Z_CLEARANCE_BETWEEN_PROBES) ) return NAN;
625
 
625
 
626
     const float first_probe_z = current_position.z;
626
     const float first_probe_z = current_position.z;
627
 
627
 
662
 
662
 
663
       // Probe downward slowly to find the bed
663
       // Probe downward slowly to find the bed
664
       if (try_to_probe(PSTR("SLOW"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW),
664
       if (try_to_probe(PSTR("SLOW"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW),
665
-                       sanity_check, Z_CLEARANCE_MULTI_PROBE) ) return MFNAN;
665
+                       sanity_check, Z_CLEARANCE_MULTI_PROBE) ) return NAN;
666
 
666
 
667
       TERN_(MEASURE_BACKLASH_WHEN_PROBING, backlash.measure_with_probe());
667
       TERN_(MEASURE_BACKLASH_WHEN_PROBING, backlash.measure_with_probe());
668
 
668
 
765
   if (probe_relative) {                                     // The given position is in terms of the probe
765
   if (probe_relative) {                                     // The given position is in terms of the probe
766
     if (!can_reach(npos)) {
766
     if (!can_reach(npos)) {
767
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
767
       if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Position Not Reachable");
768
-      return MFNAN;
768
+      return NAN;
769
     }
769
     }
770
     npos -= offset_xy;                                      // Get the nozzle position
770
     npos -= offset_xy;                                      // Get the nozzle position
771
   }
771
   }
772
-  else if (!position_is_reachable(npos)) return MFNAN;      // The given position is in terms of the nozzle
772
+  else if (!position_is_reachable(npos)) return NAN;        // The given position is in terms of the nozzle
773
 
773
 
774
   // Move the probe to the starting XYZ
774
   // Move the probe to the starting XYZ
775
   do_blocking_move_to(npos, feedRate_t(XY_PROBE_FEEDRATE_MM_S));
775
   do_blocking_move_to(npos, feedRate_t(XY_PROBE_FEEDRATE_MM_S));
776
 
776
 
777
-  float measured_z = MFNAN;
777
+  float measured_z = NAN;
778
   if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z;
778
   if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z;
779
-  if (!ISNAN(measured_z)) {
779
+  if (!isnan(measured_z)) {
780
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
780
     const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
781
     if (big_raise || raise_after == PROBE_PT_RAISE)
781
     if (big_raise || raise_after == PROBE_PT_RAISE)
782
       do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), z_probe_fast_mm_s);
782
       do_blocking_move_to_z(current_position.z + (big_raise ? 25 : Z_CLEARANCE_BETWEEN_PROBES), z_probe_fast_mm_s);
783
     else if (raise_after == PROBE_PT_STOW)
783
     else if (raise_after == PROBE_PT_STOW)
784
-      if (stow()) measured_z = MFNAN;   // Error on stow?
784
+      if (stow()) measured_z = NAN;   // Error on stow?
785
 
785
 
786
     if (verbose_level > 2)
786
     if (verbose_level > 2)
787
       SERIAL_ECHOLNPAIR("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z);
787
       SERIAL_ECHOLNPAIR("Bed X: ", LOGICAL_X_POSITION(rx), " Y: ", LOGICAL_Y_POSITION(ry), " Z: ", measured_z);
788
   }
788
   }
789
 
789
 
790
-  if (ISNAN(measured_z)) {
790
+  if (isnan(measured_z)) {
791
     stow();
791
     stow();
792
     LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
792
     LCD_MESSAGEPGM(MSG_LCD_PROBING_FAILED);
793
     #if DISABLED(G29_RETRY_AND_RECOVER)
793
     #if DISABLED(G29_RETRY_AND_RECOVER)

+ 7
- 7
Marlin/src/module/settings.cpp View File

900
       HOTEND_LOOP() {
900
       HOTEND_LOOP() {
901
         PIDCF_t pidcf = {
901
         PIDCF_t pidcf = {
902
           #if DISABLED(PIDTEMP)
902
           #if DISABLED(PIDTEMP)
903
-            MFNAN, MFNAN, MFNAN,
904
-            MFNAN, MFNAN
903
+            NAN, NAN, NAN,
904
+            NAN, NAN
905
           #else
905
           #else
906
                          PID_PARAM(Kp, e),
906
                          PID_PARAM(Kp, e),
907
             unscalePID_i(PID_PARAM(Ki, e)),
907
             unscalePID_i(PID_PARAM(Ki, e)),
928
 
928
 
929
       const PID_t bed_pid = {
929
       const PID_t bed_pid = {
930
         #if DISABLED(PIDTEMPBED)
930
         #if DISABLED(PIDTEMPBED)
931
-          MFNAN, MFNAN, MFNAN
931
+          NAN, NAN, NAN
932
         #else
932
         #else
933
           // Store the unscaled PID values
933
           // Store the unscaled PID values
934
           thermalManager.temp_bed.pid.Kp,
934
           thermalManager.temp_bed.pid.Kp,
947
 
947
 
948
       const PID_t chamber_pid = {
948
       const PID_t chamber_pid = {
949
         #if DISABLED(PIDTEMPCHAMBER)
949
         #if DISABLED(PIDTEMPCHAMBER)
950
-          MFNAN, MFNAN, MFNAN
950
+          NAN, NAN, NAN
951
         #else
951
         #else
952
           // Store the unscaled PID values
952
           // Store the unscaled PID values
953
           thermalManager.temp_chamber.pid.Kp,
953
           thermalManager.temp_chamber.pid.Kp,
1786
           PIDCF_t pidcf;
1786
           PIDCF_t pidcf;
1787
           EEPROM_READ(pidcf);
1787
           EEPROM_READ(pidcf);
1788
           #if ENABLED(PIDTEMP)
1788
           #if ENABLED(PIDTEMP)
1789
-            if (!validating && !ISNAN(pidcf.Kp)) {
1789
+            if (!validating && !isnan(pidcf.Kp)) {
1790
               // Scale PID values since EEPROM values are unscaled
1790
               // Scale PID values since EEPROM values are unscaled
1791
               PID_PARAM(Kp, e) = pidcf.Kp;
1791
               PID_PARAM(Kp, e) = pidcf.Kp;
1792
               PID_PARAM(Ki, e) = scalePID_i(pidcf.Ki);
1792
               PID_PARAM(Ki, e) = scalePID_i(pidcf.Ki);
1818
         PID_t pid;
1818
         PID_t pid;
1819
         EEPROM_READ(pid);
1819
         EEPROM_READ(pid);
1820
         #if ENABLED(PIDTEMPBED)
1820
         #if ENABLED(PIDTEMPBED)
1821
-          if (!validating && !ISNAN(pid.Kp)) {
1821
+          if (!validating && !isnan(pid.Kp)) {
1822
             // Scale PID values since EEPROM values are unscaled
1822
             // Scale PID values since EEPROM values are unscaled
1823
             thermalManager.temp_bed.pid.Kp = pid.Kp;
1823
             thermalManager.temp_bed.pid.Kp = pid.Kp;
1824
             thermalManager.temp_bed.pid.Ki = scalePID_i(pid.Ki);
1824
             thermalManager.temp_bed.pid.Ki = scalePID_i(pid.Ki);
1834
         PID_t pid;
1834
         PID_t pid;
1835
         EEPROM_READ(pid);
1835
         EEPROM_READ(pid);
1836
         #if ENABLED(PIDTEMPCHAMBER)
1836
         #if ENABLED(PIDTEMPCHAMBER)
1837
-          if (!validating && !ISNAN(pid.Kp)) {
1837
+          if (!validating && !isnan(pid.Kp)) {
1838
             // Scale PID values since EEPROM values are unscaled
1838
             // Scale PID values since EEPROM values are unscaled
1839
             thermalManager.temp_chamber.pid.Kp = pid.Kp;
1839
             thermalManager.temp_chamber.pid.Kp = pid.Kp;
1840
             thermalManager.temp_chamber.pid.Ki = scalePID_i(pid.Ki);
1840
             thermalManager.temp_chamber.pid.Ki = scalePID_i(pid.Ki);

+ 3
- 3
Marlin/src/module/temperature.h View File

74
 #endif
74
 #endif
75
 
75
 
76
 #define PID_PARAM(F,H) _PID_##F(TERN(PID_PARAMS_PER_HOTEND, H, 0 & H)) // Always use 'H' to suppress warning
76
 #define PID_PARAM(F,H) _PID_##F(TERN(PID_PARAMS_PER_HOTEND, H, 0 & H)) // Always use 'H' to suppress warning
77
-#define _PID_Kp(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kp, MFNAN)
78
-#define _PID_Ki(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Ki, MFNAN)
79
-#define _PID_Kd(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kd, MFNAN)
77
+#define _PID_Kp(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kp, NAN)
78
+#define _PID_Ki(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Ki, NAN)
79
+#define _PID_Kd(H) TERN(PIDTEMP, Temperature::temp_hotend[H].pid.Kd, NAN)
80
 #if ENABLED(PIDTEMP)
80
 #if ENABLED(PIDTEMP)
81
   #define _PID_Kc(H) TERN(PID_EXTRUSION_SCALING, Temperature::temp_hotend[H].pid.Kc, 1)
81
   #define _PID_Kc(H) TERN(PID_EXTRUSION_SCALING, Temperature::temp_hotend[H].pid.Kc, 1)
82
   #define _PID_Kf(H) TERN(PID_FAN_SCALING,       Temperature::temp_hotend[H].pid.Kf, 0)
82
   #define _PID_Kf(H) TERN(PID_FAN_SCALING,       Temperature::temp_hotend[H].pid.Kf, 0)

+ 1
- 1
platformio.ini View File

38
 # The 'common' values are used for most Marlin builds
38
 # The 'common' values are used for most Marlin builds
39
 #
39
 #
40
 [common]
40
 [common]
41
-build_flags        = -fmax-errors=5 -g3 -D__MARLIN_FIRMWARE__ -fmerge-constants -fno-signed-zeros -ffinite-math-only
41
+build_flags        = -fmax-errors=5 -g3 -D__MARLIN_FIRMWARE__ -fmerge-constants
42
 extra_scripts      =
42
 extra_scripts      =
43
   pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
43
   pre:buildroot/share/PlatformIO/scripts/common-dependencies.py
44
   pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
44
   pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py

Loading…
Cancel
Save