Просмотр исходного кода

Replace 'const float &' with 'const_float_t' (#21505)

Scott Lahteine 3 лет назад
Родитель
Сommit
62f37669dc
Аккаунт пользователя с таким Email не найден
79 измененных файлов: 376 добавлений и 366 удалений
  1. 1
    1
      Marlin/src/HAL/AVR/fastio.cpp
  2. 1
    1
      Marlin/src/core/serial.cpp
  3. 1
    1
      Marlin/src/core/serial.h
  4. 10
    0
      Marlin/src/core/types.h
  5. 1
    1
      Marlin/src/feature/babystep.cpp
  6. 1
    1
      Marlin/src/feature/babystep.h
  7. 1
    1
      Marlin/src/feature/backlash.h
  8. 2
    2
      Marlin/src/feature/bedlevel/abl/abl.cpp
  9. 1
    1
      Marlin/src/feature/bedlevel/abl/abl.h
  10. 1
    1
      Marlin/src/feature/bedlevel/bedlevel.cpp
  11. 1
    1
      Marlin/src/feature/bedlevel/bedlevel.h
  12. 1
    1
      Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp
  13. 11
    11
      Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h
  14. 2
    2
      Marlin/src/feature/bedlevel/ubl/ubl.cpp
  15. 22
    22
      Marlin/src/feature/bedlevel/ubl/ubl.h
  16. 6
    6
      Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp
  17. 2
    2
      Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp
  18. 1
    1
      Marlin/src/feature/encoder_i2c.h
  19. 1
    1
      Marlin/src/feature/filwidth.h
  20. 4
    4
      Marlin/src/feature/leds/printer_event_leds.cpp
  21. 3
    3
      Marlin/src/feature/leds/printer_event_leds.h
  22. 1
    1
      Marlin/src/feature/max7219.cpp
  23. 7
    0
      Marlin/src/feature/max7219.h
  24. 1
    1
      Marlin/src/feature/mixing.cpp
  25. 2
    2
      Marlin/src/feature/mixing.h
  26. 5
    5
      Marlin/src/feature/pause.cpp
  27. 5
    5
      Marlin/src/feature/pause.h
  28. 1
    1
      Marlin/src/feature/powerloss.cpp
  29. 1
    1
      Marlin/src/feature/powerloss.h
  30. 4
    4
      Marlin/src/feature/probe_temp_comp.cpp
  31. 4
    4
      Marlin/src/feature/probe_temp_comp.h
  32. 1
    1
      Marlin/src/feature/runout.h
  33. 1
    1
      Marlin/src/feature/spindle_laser.h
  34. 2
    2
      Marlin/src/gcode/bedlevel/G26.cpp
  35. 1
    1
      Marlin/src/gcode/calibrate/G33.cpp
  36. 1
    1
      Marlin/src/gcode/calibrate/G34_M422.cpp
  37. 1
    1
      Marlin/src/gcode/calibrate/M48.cpp
  38. 1
    1
      Marlin/src/gcode/feature/camera/M240.cpp
  39. 1
    1
      Marlin/src/gcode/feature/mixing/M166.cpp
  40. 1
    1
      Marlin/src/gcode/motion/M290.cpp
  41. 6
    6
      Marlin/src/gcode/parser.h
  42. 1
    1
      Marlin/src/lcd/dogm/marlinui_DOGM.cpp
  43. 1
    1
      Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp
  44. 1
    1
      Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp
  45. 1
    1
      Marlin/src/lcd/extui/dgus_lcd.cpp
  46. 1
    1
      Marlin/src/lcd/extui/example.cpp
  47. 1
    1
      Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp
  48. 1
    1
      Marlin/src/lcd/extui/malyan_lcd.cpp
  49. 35
    35
      Marlin/src/lcd/extui/ui_api.cpp
  50. 37
    37
      Marlin/src/lcd/extui/ui_api.h
  51. 1
    1
      Marlin/src/lcd/marlinui.h
  52. 1
    1
      Marlin/src/lcd/menu/menu.cpp
  53. 2
    6
      Marlin/src/lcd/menu/menu.h
  54. 1
    1
      Marlin/src/lcd/menu/menu_delta_calibrate.cpp
  55. 5
    5
      Marlin/src/lcd/menu/menu_item.h
  56. 1
    1
      Marlin/src/lcd/menu/menu_motion.cpp
  57. 2
    2
      Marlin/src/lcd/menu/menu_probe_offset.cpp
  58. 1
    1
      Marlin/src/lcd/menu/menu_ubl.cpp
  59. 2
    2
      Marlin/src/libs/L64XX/L64XX_Marlin.cpp
  60. 4
    4
      Marlin/src/libs/least_squares_fit.h
  61. 2
    2
      Marlin/src/libs/nozzle.cpp
  62. 2
    2
      Marlin/src/libs/nozzle.h
  63. 19
    19
      Marlin/src/libs/numtostr.cpp
  64. 23
    26
      Marlin/src/libs/numtostr.h
  65. 1
    1
      Marlin/src/libs/vector_3.h
  66. 1
    1
      Marlin/src/module/delta.cpp
  67. 1
    1
      Marlin/src/module/delta.h
  68. 16
    16
      Marlin/src/module/motion.cpp
  69. 23
    23
      Marlin/src/module/motion.h
  70. 11
    11
      Marlin/src/module/planner.cpp
  71. 28
    28
      Marlin/src/module/planner.h
  72. 4
    4
      Marlin/src/module/planner_bezier.cpp
  73. 1
    1
      Marlin/src/module/planner_bezier.h
  74. 3
    3
      Marlin/src/module/probe.cpp
  75. 6
    6
      Marlin/src/module/probe.h
  76. 2
    2
      Marlin/src/module/scara.cpp
  77. 2
    2
      Marlin/src/module/scara.h
  78. 4
    4
      Marlin/src/module/temperature.cpp
  79. 7
    7
      Marlin/src/module/temperature.h

+ 1
- 1
Marlin/src/HAL/AVR/fastio.cpp Просмотреть файл

@@ -241,7 +241,7 @@ uint8_t extDigitalRead(const int8_t pin) {
241 241
  *
242 242
  * DC values -1.0 to 1.0. Negative duty cycle inverts the pulse.
243 243
  */
244
-uint16_t set_pwm_frequency_hz(const float &hz, const float dca, const float dcb, const float dcc) {
244
+uint16_t set_pwm_frequency_hz(const_float_t hz, const float dca, const float dcb, const float dcc) {
245 245
   float count = 0;
246 246
   if (hz > 0 && (dca || dcb || dcc)) {
247 247
     count = float(F_CPU) / hz;            // 1x prescaler, TOP for 16MHz base freq.

+ 1
- 1
Marlin/src/core/serial.cpp Просмотреть файл

@@ -91,7 +91,7 @@ void print_bin(uint16_t val) {
91 91
   }
92 92
 }
93 93
 
94
-void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
94
+void print_xyz(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) {
95 95
   if (prefix) serialprintPGM(prefix);
96 96
   SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z);
97 97
   if (suffix) serialprintPGM(suffix); else SERIAL_EOL();

+ 1
- 1
Marlin/src/core/serial.h Просмотреть файл

@@ -387,7 +387,7 @@ void serialprint_truefalse(const bool tf);
387 387
 void serial_spaces(uint8_t count);
388 388
 
389 389
 void print_bin(const uint16_t val);
390
-void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
390
+void print_xyz(const_float_t x, const_float_t y, const_float_t z, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr);
391 391
 
392 392
 inline void print_xyz(const xyz_pos_t &xyz, PGM_P const prefix=nullptr, PGM_P const suffix=nullptr) {
393 393
   print_xyz(xyz.x, xyz.y, xyz.z, prefix, suffix);

+ 10
- 0
Marlin/src/core/types.h Просмотреть файл

@@ -78,6 +78,16 @@ typedef float feedRate_t;
78 78
 //
79 79
 typedef int16_t celsius_t;
80 80
 
81
+//
82
+// On AVR pointers are only 2 bytes so use 'const float &' for 'const float'
83
+//
84
+#ifdef __AVR__
85
+  typedef const float & const_float_t;
86
+#else
87
+  typedef const float const_float_t;
88
+#endif
89
+typedef const_float_t const_feedRate_t;
90
+
81 91
 // Conversion macros
82 92
 #define MMM_TO_MMS(MM_M) feedRate_t(float(MM_M) / 60.0f)
83 93
 #define MMS_TO_MMM(MM_S) (float(MM_S) * 60.0f)

+ 1
- 1
Marlin/src/feature/babystep.cpp Просмотреть файл

@@ -50,7 +50,7 @@ void Babystep::step_axis(const AxisEnum axis) {
50 50
   }
51 51
 }
52 52
 
53
-void Babystep::add_mm(const AxisEnum axis, const float &mm) {
53
+void Babystep::add_mm(const AxisEnum axis, const_float_t mm) {
54 54
   add_steps(axis, mm * planner.settings.axis_steps_per_mm[axis]);
55 55
 }
56 56
 

+ 1
- 1
Marlin/src/feature/babystep.h Просмотреть файл

@@ -61,7 +61,7 @@ public:
61 61
   #endif
62 62
 
63 63
   static void add_steps(const AxisEnum axis, const int16_t distance);
64
-  static void add_mm(const AxisEnum axis, const float &mm);
64
+  static void add_mm(const AxisEnum axis, const_float_t mm);
65 65
 
66 66
   static inline bool has_steps() {
67 67
     return steps[BS_AXIS_IND(X_AXIS)] || steps[BS_AXIS_IND(Y_AXIS)] || steps[BS_AXIS_IND(Z_AXIS)];

+ 1
- 1
Marlin/src/feature/backlash.h Просмотреть файл

@@ -35,7 +35,7 @@ public:
35 35
       static float smoothing_mm;
36 36
     #endif
37 37
 
38
-    static inline void set_correction(const float &v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; }
38
+    static inline void set_correction(const_float_t v) { correction = _MAX(0, _MIN(1.0, v)) * all_on; }
39 39
     static inline float get_correction() { return float(ui8_to_percent(correction)) / 100.0f; }
40 40
   #else
41 41
     static constexpr uint8_t correction = (BACKLASH_CORRECTION) * 0xFF;

+ 2
- 2
Marlin/src/feature/bedlevel/abl/abl.cpp Просмотреть файл

@@ -213,7 +213,7 @@ void print_bilinear_leveling_grid() {
213 213
     ) * 0.5f;
214 214
   }
215 215
 
216
-  static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const float &tx, const float &ty) {
216
+  static float bed_level_virt_2cmr(const uint8_t x, const uint8_t y, const_float_t tx, const_float_t ty) {
217 217
     float row[4], column[4];
218 218
     LOOP_L_N(i, 4) {
219 219
       LOOP_L_N(j, 4) {
@@ -356,7 +356,7 @@ float bilinear_z_offset(const xy_pos_t &raw) {
356 356
    * Prepare a bilinear-leveled linear move on Cartesian,
357 357
    * splitting the move where it crosses grid borders.
358 358
    */
359
-  void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
359
+  void bilinear_line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits, uint16_t y_splits) {
360 360
     // Get current and destination cells for this line
361 361
     xy_int_t c1 { CELL_INDEX(x, current_position.x), CELL_INDEX(y, current_position.y) },
362 362
              c2 { CELL_INDEX(x, destination.x), CELL_INDEX(y, destination.y) };

+ 1
- 1
Marlin/src/feature/bedlevel/abl/abl.h Просмотреть файл

@@ -37,7 +37,7 @@ void refresh_bed_level();
37 37
 #endif
38 38
 
39 39
 #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
40
-  void bilinear_line_to_destination(const feedRate_t &scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
40
+  void bilinear_line_to_destination(const_feedRate_t scaled_fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
41 41
 #endif
42 42
 
43 43
 #define _GET_MESH_X(I) float(bilinear_start.x + (I) * bilinear_grid_spacing.x)

+ 1
- 1
Marlin/src/feature/bedlevel/bedlevel.cpp Просмотреть файл

@@ -98,7 +98,7 @@ TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved(
98 98
 
99 99
 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
100 100
 
101
-  void set_z_fade_height(const float &zfh, const bool do_report/*=true*/) {
101
+  void set_z_fade_height(const_float_t zfh, const bool do_report/*=true*/) {
102 102
 
103 103
     if (planner.z_fade_height == zfh) return;
104 104
 

+ 1
- 1
Marlin/src/feature/bedlevel/bedlevel.h Просмотреть файл

@@ -38,7 +38,7 @@ void set_bed_leveling_enabled(const bool enable=true);
38 38
 void reset_bed_level();
39 39
 
40 40
 #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
41
-  void set_z_fade_height(const float &zfh, const bool do_report=true);
41
+  void set_z_fade_height(const_float_t zfh, const bool do_report=true);
42 42
 #endif
43 43
 
44 44
 #if EITHER(MESH_BED_LEVELING, PROBE_MANUALLY)

+ 1
- 1
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.cpp Просмотреть файл

@@ -61,7 +61,7 @@
61 61
      * Prepare a mesh-leveled linear move in a Cartesian setup,
62 62
      * splitting the move where it crosses mesh borders.
63 63
      */
64
-    void mesh_bed_leveling::line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
64
+    void mesh_bed_leveling::line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits, uint8_t y_splits) {
65 65
       // Get current and destination cells for this line
66 66
       xy_int8_t scel = cell_indexes(current_position), ecel = cell_indexes(destination);
67 67
       NOMORE(scel.x, GRID_MAX_POINTS_X - 2);

+ 11
- 11
Marlin/src/feature/bedlevel/mbl/mesh_bed_leveling.h Просмотреть файл

@@ -56,7 +56,7 @@ public:
56 56
     return false;
57 57
   }
58 58
 
59
-  static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
59
+  static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; }
60 60
 
61 61
   static inline void zigzag(const int8_t index, int8_t &px, int8_t &py) {
62 62
     px = index % (GRID_MAX_POINTS_X);
@@ -64,39 +64,39 @@ public:
64 64
     if (py & 1) px = (GRID_MAX_POINTS_X - 1) - px; // Zig zag
65 65
   }
66 66
 
67
-  static void set_zigzag_z(const int8_t index, const float &z) {
67
+  static void set_zigzag_z(const int8_t index, const_float_t z) {
68 68
     int8_t px, py;
69 69
     zigzag(index, px, py);
70 70
     set_z(px, py, z);
71 71
   }
72 72
 
73
-  static int8_t cell_index_x(const float &x) {
73
+  static int8_t cell_index_x(const_float_t x) {
74 74
     int8_t cx = (x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST);
75 75
     return constrain(cx, 0, (GRID_MAX_POINTS_X) - 2);
76 76
   }
77
-  static int8_t cell_index_y(const float &y) {
77
+  static int8_t cell_index_y(const_float_t y) {
78 78
     int8_t cy = (y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST);
79 79
     return constrain(cy, 0, (GRID_MAX_POINTS_Y) - 2);
80 80
   }
81
-  static inline xy_int8_t cell_indexes(const float &x, const float &y) {
81
+  static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
82 82
     return { cell_index_x(x), cell_index_y(y) };
83 83
   }
84 84
   static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
85 85
 
86
-  static int8_t probe_index_x(const float &x) {
86
+  static int8_t probe_index_x(const_float_t x) {
87 87
     int8_t px = (x - (MESH_MIN_X) + 0.5f * (MESH_X_DIST)) * RECIPROCAL(MESH_X_DIST);
88 88
     return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
89 89
   }
90
-  static int8_t probe_index_y(const float &y) {
90
+  static int8_t probe_index_y(const_float_t y) {
91 91
     int8_t py = (y - (MESH_MIN_Y) + 0.5f * (MESH_Y_DIST)) * RECIPROCAL(MESH_Y_DIST);
92 92
     return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1;
93 93
   }
94
-  static inline xy_int8_t probe_indexes(const float &x, const float &y) {
94
+  static inline xy_int8_t probe_indexes(const_float_t x, const_float_t y) {
95 95
     return { probe_index_x(x), probe_index_y(y) };
96 96
   }
97 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 &a0, const float &a1, const float &z1, const float &a2, const float &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 100
     const float delta_z = (z2 - z1) / (a2 - a1),
101 101
                 delta_a = a0 - a1;
102 102
     return z1 + delta_a * delta_z;
@@ -104,7 +104,7 @@ public:
104 104
 
105 105
   static float get_z(const xy_pos_t &pos
106 106
     #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
107
-      , const float &factor=1.0f
107
+      , const_float_t factor=1.0f
108 108
     #endif
109 109
   ) {
110 110
     #if DISABLED(ENABLE_LEVELING_FADE_HEIGHT)
@@ -120,7 +120,7 @@ public:
120 120
   }
121 121
 
122 122
   #if IS_CARTESIAN && DISABLED(SEGMENT_LEVELED_MOVES)
123
-    static void line_to_destination(const feedRate_t &scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
123
+    static void line_to_destination(const_feedRate_t scaled_fr_mm_s, uint8_t x_splits=0xFF, uint8_t y_splits=0xFF);
124 124
   #endif
125 125
 };
126 126
 

+ 2
- 2
Marlin/src/feature/bedlevel/ubl/ubl.cpp Просмотреть файл

@@ -102,7 +102,7 @@ void unified_bed_leveling::invalidate() {
102 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 value) {
105
+void unified_bed_leveling::set_all_mesh_points_to_value(const_float_t value) {
106 106
   GRID_LOOP(x, y) {
107 107
     z_values[x][y] = value;
108 108
     TERN_(EXTENSIBLE_UI, ExtUI::onMeshUpdate(x, y, value));
@@ -115,7 +115,7 @@ void unified_bed_leveling::set_all_mesh_points_to_value(const float value) {
115 115
   constexpr int16_t Z_STEPS_NAN = INT16_MAX;
116 116
 
117 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 &z) {
118
+    auto z_to_store = [](const_float_t z) {
119 119
       if (isnan(z)) return Z_STEPS_NAN;
120 120
       const int32_t z_scaled = TRUNC(z * mesh_store_scaling);
121 121
       if (z_scaled == Z_STEPS_NAN || !WITHIN(z_scaled, INT16_MIN, INT16_MAX))

+ 22
- 22
Marlin/src/feature/bedlevel/ubl/ubl.h Просмотреть файл

@@ -67,17 +67,17 @@ private:
67 67
   static G29_parameters_t param;
68 68
 
69 69
   #if IS_NEWPANEL
70
-    static void move_z_with_encoder(const float &multiplier);
70
+    static void move_z_with_encoder(const_float_t multiplier);
71 71
     static float measure_point_with_encoder();
72 72
     static float measure_business_card_thickness();
73
-    static void manually_probe_remaining_mesh(const xy_pos_t&, const float&, const float&, const bool) _O0;
73
+    static void manually_probe_remaining_mesh(const xy_pos_t&, const_float_t , const_float_t , const bool) _O0;
74 74
     static void fine_tune_mesh(const xy_pos_t &pos, const bool do_ubl_mesh_map) _O0;
75 75
   #endif
76 76
 
77 77
   static bool G29_parse_parameters() _O0;
78 78
   static void shift_mesh_height();
79 79
   static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) _O0;
80
-  static void tilt_mesh_based_on_3pts(const float &z1, const float &z2, const float &z3);
80
+  static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3);
81 81
   static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
82 82
   static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
83 83
   static inline bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) {
@@ -103,12 +103,12 @@ public:
103 103
   static mesh_index_pair find_furthest_invalid_mesh_point() _O0;
104 104
   static void reset();
105 105
   static void invalidate();
106
-  static void set_all_mesh_points_to_value(const float value);
107
-  static void adjust_mesh_to_mean(const bool cflag, const float value);
106
+  static void set_all_mesh_points_to_value(const_float_t value);
107
+  static void adjust_mesh_to_mean(const bool cflag, const_float_t value);
108 108
   static bool sanity_check();
109 109
 
110 110
   static void G29() _O0;                          // O0 for no optimization
111
-  static void smart_fill_wlsf(const float &) _O2; // O2 gives smaller code than Os on A2560
111
+  static void smart_fill_wlsf(const_float_t ) _O2; // O2 gives smaller code than Os on A2560
112 112
 
113 113
   static int8_t storage_slot;
114 114
 
@@ -131,42 +131,42 @@ public:
131 131
 
132 132
   unified_bed_leveling();
133 133
 
134
-  FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const float &z) { z_values[px][py] = z; }
134
+  FORCE_INLINE static void set_z(const int8_t px, const int8_t py, const_float_t z) { z_values[px][py] = z; }
135 135
 
136
-  static int8_t cell_index_x_raw(const float &x) {
136
+  static int8_t cell_index_x_raw(const_float_t x) {
137 137
     return FLOOR((x - (MESH_MIN_X)) * RECIPROCAL(MESH_X_DIST));
138 138
   }
139 139
 
140
-  static int8_t cell_index_y_raw(const float &y) {
140
+  static int8_t cell_index_y_raw(const_float_t y) {
141 141
     return FLOOR((y - (MESH_MIN_Y)) * RECIPROCAL(MESH_Y_DIST));
142 142
   }
143 143
 
144
-  static int8_t cell_index_x_valid(const float &x) {
144
+  static int8_t cell_index_x_valid(const_float_t x) {
145 145
     return WITHIN(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X - 2));
146 146
   }
147 147
 
148
-  static int8_t cell_index_y_valid(const float &y) {
148
+  static int8_t cell_index_y_valid(const_float_t y) {
149 149
     return WITHIN(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y - 2));
150 150
   }
151 151
 
152
-  static int8_t cell_index_x(const float &x) {
152
+  static int8_t cell_index_x(const_float_t x) {
153 153
     return constrain(cell_index_x_raw(x), 0, (GRID_MAX_POINTS_X) - 2);
154 154
   }
155 155
 
156
-  static int8_t cell_index_y(const float &y) {
156
+  static int8_t cell_index_y(const_float_t y) {
157 157
     return constrain(cell_index_y_raw(y), 0, (GRID_MAX_POINTS_Y) - 2);
158 158
   }
159 159
 
160
-  static inline xy_int8_t cell_indexes(const float &x, const float &y) {
160
+  static inline xy_int8_t cell_indexes(const_float_t x, const_float_t y) {
161 161
     return { cell_index_x(x), cell_index_y(y) };
162 162
   }
163 163
   static inline xy_int8_t cell_indexes(const xy_pos_t &xy) { return cell_indexes(xy.x, xy.y); }
164 164
 
165
-  static int8_t closest_x_index(const float &x) {
165
+  static int8_t closest_x_index(const_float_t x) {
166 166
     const int8_t px = (x - (MESH_MIN_X) + (MESH_X_DIST) * 0.5) * RECIPROCAL(MESH_X_DIST);
167 167
     return WITHIN(px, 0, GRID_MAX_POINTS_X - 1) ? px : -1;
168 168
   }
169
-  static int8_t closest_y_index(const float &y) {
169
+  static int8_t closest_y_index(const_float_t y) {
170 170
     const int8_t py = (y - (MESH_MIN_Y) + (MESH_Y_DIST) * 0.5) * RECIPROCAL(MESH_Y_DIST);
171 171
     return WITHIN(py, 0, GRID_MAX_POINTS_Y - 1) ? py : -1;
172 172
   }
@@ -189,7 +189,7 @@ public:
189 189
    *  It is fairly expensive with its 4 floating point additions and 2 floating point
190 190
    *  multiplications.
191 191
    */
192
-  FORCE_INLINE static float calc_z0(const float &a0, const float &a1, const float &z1, const float &a2, const float &z2) {
192
+  FORCE_INLINE static float calc_z0(const_float_t a0, const_float_t a1, const_float_t z1, const_float_t a2, const_float_t z2) {
193 193
     return z1 + (z2 - z1) * (a0 - a1) / (a2 - a1);
194 194
   }
195 195
 
@@ -203,7 +203,7 @@ public:
203 203
    * z_correction_for_x_on_horizontal_mesh_line is an optimization for
204 204
    * the case where the printer is making a vertical line that only crosses horizontal mesh lines.
205 205
    */
206
-  static inline float z_correction_for_x_on_horizontal_mesh_line(const float &rx0, const int x1_i, const int yi) {
206
+  static inline float z_correction_for_x_on_horizontal_mesh_line(const_float_t rx0, const int x1_i, const int yi) {
207 207
     if (!WITHIN(x1_i, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(yi, 0, GRID_MAX_POINTS_Y - 1)) {
208 208
 
209 209
       if (DEBUGGING(LEVELING)) {
@@ -226,7 +226,7 @@ public:
226 226
   //
227 227
   // See comments above for z_correction_for_x_on_horizontal_mesh_line
228 228
   //
229
-  static inline float z_correction_for_y_on_vertical_mesh_line(const float &ry0, const int xi, const int y1_i) {
229
+  static inline float z_correction_for_y_on_vertical_mesh_line(const_float_t ry0, const int xi, const int y1_i) {
230 230
     if (!WITHIN(xi, 0, GRID_MAX_POINTS_X - 1) || !WITHIN(y1_i, 0, GRID_MAX_POINTS_Y - 1)) {
231 231
 
232 232
       if (DEBUGGING(LEVELING)) {
@@ -252,7 +252,7 @@ public:
252 252
    * Z-Height at both ends. Then it does a linear interpolation of these heights based
253 253
    * on the Y position within the cell.
254 254
    */
255
-  static float get_z_correction(const float &rx0, const float &ry0) {
255
+  static float get_z_correction(const_float_t rx0, const_float_t ry0) {
256 256
     const int8_t cx = cell_index_x(rx0), cy = cell_index_y(ry0); // return values are clamped
257 257
 
258 258
     /**
@@ -309,9 +309,9 @@ public:
309 309
   }
310 310
 
311 311
   #if UBL_SEGMENTED
312
-    static bool line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s);
312
+    static bool line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s);
313 313
   #else
314
-    static void line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t e);
314
+    static void line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t e);
315 315
   #endif
316 316
 
317 317
   static inline bool mesh_is_valid() {

+ 6
- 6
Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp Просмотреть файл

@@ -672,7 +672,7 @@ void unified_bed_leveling::G29() {
672 672
  * G29 P5 C<value> : Adjust Mesh To Mean (and subtract the given offset).
673 673
  *                   Find the mean average and shift the mesh to center on that value.
674 674
  */
675
-void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const float offset) {
675
+void unified_bed_leveling::adjust_mesh_to_mean(const bool cflag, const_float_t offset) {
676 676
   float sum = 0;
677 677
   int n = 0;
678 678
   GRID_LOOP(x, y)
@@ -821,7 +821,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
821 821
     return false;
822 822
   }
823 823
 
824
-  void unified_bed_leveling::move_z_with_encoder(const float &multiplier) {
824
+  void unified_bed_leveling::move_z_with_encoder(const_float_t multiplier) {
825 825
     ui.wait_for_release();
826 826
     while (!ui.button_pressed()) {
827 827
       idle();
@@ -883,7 +883,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
883 883
    *          Move to INVALID points and
884 884
    *          NOTE: Blocks the G-code queue and captures Marlin UI during use.
885 885
    */
886
-  void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const float &z_clearance, const float &thick, const bool do_ubl_mesh_map) {
886
+  void unified_bed_leveling::manually_probe_remaining_mesh(const xy_pos_t &pos, const_float_t z_clearance, const_float_t thick, const bool do_ubl_mesh_map) {
887 887
     ui.capture();
888 888
 
889 889
     save_ubl_active_state_and_disable();  // No bed level correction so only raw data is obtained
@@ -1633,10 +1633,10 @@ void unified_bed_leveling::smart_fill_mesh() {
1633 1633
        */
1634 1634
       #ifdef VALIDATE_MESH_TILT
1635 1635
         auto d_from = []{ DEBUG_ECHOPGM("D from "); };
1636
-        auto normed = [&](const xy_pos_t &pos, const float &zadd) {
1636
+        auto normed = [&](const xy_pos_t &pos, const_float_t zadd) {
1637 1637
           return normal.x * pos.x + normal.y * pos.y + zadd;
1638 1638
         };
1639
-        auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const float &zadd) {
1639
+        auto debug_pt = [](PGM_P const pre, const xy_pos_t &pos, const_float_t zadd) {
1640 1640
           d_from(); SERIAL_ECHOPGM_P(pre);
1641 1641
           DEBUG_ECHO_F(normed(pos, zadd), 6);
1642 1642
           DEBUG_ECHOLNPAIR_F("   Z error = ", zadd - get_z_correction(pos), 6);
@@ -1658,7 +1658,7 @@ void unified_bed_leveling::smart_fill_mesh() {
1658 1658
 #endif // HAS_BED_PROBE
1659 1659
 
1660 1660
 #if ENABLED(UBL_G29_P31)
1661
-  void unified_bed_leveling::smart_fill_wlsf(const float &weight_factor) {
1661
+  void unified_bed_leveling::smart_fill_wlsf(const_float_t weight_factor) {
1662 1662
 
1663 1663
     // For each undefined mesh point, compute a distance-weighted least squares fit
1664 1664
     // from all the originally populated mesh points, weighted toward the point

+ 2
- 2
Marlin/src/feature/bedlevel/ubl/ubl_motion.cpp Просмотреть файл

@@ -37,7 +37,7 @@
37 37
 
38 38
 #if !UBL_SEGMENTED
39 39
 
40
-  void unified_bed_leveling::line_to_destination_cartesian(const feedRate_t &scaled_fr_mm_s, const uint8_t extruder) {
40
+  void unified_bed_leveling::line_to_destination_cartesian(const_feedRate_t scaled_fr_mm_s, const uint8_t extruder) {
41 41
     /**
42 42
      * Much of the nozzle movement will be within the same cell. So we will do as little computation
43 43
      * as possible to determine if this is the case. If this move is within the same cell, we will
@@ -323,7 +323,7 @@
323 323
    * Returns true if did NOT move, false if moved (requires current_position update).
324 324
    */
325 325
 
326
-  bool _O2 unified_bed_leveling::line_to_destination_segmented(const feedRate_t &scaled_fr_mm_s) {
326
+  bool _O2 unified_bed_leveling::line_to_destination_segmented(const_feedRate_t scaled_fr_mm_s) {
327 327
 
328 328
     if (!position_is_reachable(destination))  // fail if moving outside reachable boundary
329 329
       return true;                            // did not move, so current_position still accurate

+ 1
- 1
Marlin/src/feature/encoder_i2c.h Просмотреть файл

@@ -188,7 +188,7 @@ class I2CPositionEncoder {
188 188
     FORCE_INLINE void set_ec_method(const byte method) { ecMethod = method; }
189 189
 
190 190
     FORCE_INLINE float get_ec_threshold() { return ecThreshold; }
191
-    FORCE_INLINE void set_ec_threshold(const float newThreshold) { ecThreshold = newThreshold; }
191
+    FORCE_INLINE void set_ec_threshold(const_float_t newThreshold) { ecThreshold = newThreshold; }
192 192
 
193 193
     FORCE_INLINE int get_encoder_ticks_mm() {
194 194
       switch (type) {

+ 1
- 1
Marlin/src/feature/filwidth.h Просмотреть файл

@@ -78,7 +78,7 @@ public:
78 78
   static inline void update_measured_mm() { measured_mm = raw_to_mm(); }
79 79
 
80 80
   // Update ring buffer used to delay filament measurements
81
-  static inline void advance_e(const float &e_move) {
81
+  static inline void advance_e(const_float_t e_move) {
82 82
 
83 83
     // Increment counters with the E distance
84 84
     e_count += e_move;

+ 4
- 4
Marlin/src/feature/leds/printer_event_leds.cpp Просмотреть файл

@@ -40,7 +40,7 @@ PrinterEventLEDs printerEventLEDs;
40 40
 
41 41
   uint8_t PrinterEventLEDs::old_intensity = 0;
42 42
 
43
-  inline uint8_t pel_intensity(const float &start, const float &current, const float &target) {
43
+  inline uint8_t pel_intensity(const_float_t start, const_float_t current, const_float_t target) {
44 44
     if (uint16_t(start) == uint16_t(target)) return 255;
45 45
     return (uint8_t)map(constrain(current, start, target), start, target, 0.f, 255.f);
46 46
   }
@@ -58,7 +58,7 @@ PrinterEventLEDs printerEventLEDs;
58 58
 
59 59
 #if HAS_TEMP_HOTEND
60 60
 
61
-  void PrinterEventLEDs::onHotendHeating(const float &start, const float &current, const float &target) {
61
+  void PrinterEventLEDs::onHotendHeating(const_float_t start, const_float_t current, const_float_t target) {
62 62
     const uint8_t blue = pel_intensity(start, current, target);
63 63
     if (blue != old_intensity) {
64 64
       old_intensity = blue;
@@ -70,7 +70,7 @@ PrinterEventLEDs printerEventLEDs;
70 70
 
71 71
 #if HAS_HEATED_BED
72 72
 
73
-  void PrinterEventLEDs::onBedHeating(const float &start, const float &current, const float &target) {
73
+  void PrinterEventLEDs::onBedHeating(const_float_t start, const_float_t current, const_float_t target) {
74 74
     const uint8_t red = pel_intensity(start, current, target);
75 75
     if (red != old_intensity) {
76 76
       old_intensity = red;
@@ -82,7 +82,7 @@ PrinterEventLEDs printerEventLEDs;
82 82
 
83 83
 #if HAS_HEATED_CHAMBER
84 84
 
85
-  void PrinterEventLEDs::onChamberHeating(const float &start, const float &current, const float &target) {
85
+  void PrinterEventLEDs::onChamberHeating(const_float_t start, const_float_t current, const_float_t target) {
86 86
     const uint8_t green = pel_intensity(start, current, target);
87 87
     if (green != old_intensity) {
88 88
       old_intensity = green;

+ 3
- 3
Marlin/src/feature/leds/printer_event_leds.h Просмотреть файл

@@ -47,17 +47,17 @@ private:
47 47
 public:
48 48
   #if HAS_TEMP_HOTEND
49 49
     static inline LEDColor onHotendHeatingStart() { old_intensity = 0; return leds.get_color(); }
50
-    static void onHotendHeating(const float &start, const float &current, const float &target);
50
+    static void onHotendHeating(const_float_t start, const_float_t current, const_float_t target);
51 51
   #endif
52 52
 
53 53
   #if HAS_HEATED_BED
54 54
     static inline LEDColor onBedHeatingStart() { old_intensity = 127; return leds.get_color(); }
55
-    static void onBedHeating(const float &start, const float &current, const float &target);
55
+    static void onBedHeating(const_float_t start, const_float_t current, const_float_t target);
56 56
   #endif
57 57
 
58 58
   #if HAS_HEATED_CHAMBER
59 59
     static inline LEDColor onChamberHeatingStart() { old_intensity = 127; return leds.get_color(); }
60
-    static void onChamberHeating(const float &start, const float &current, const float &target);
60
+    static void onChamberHeating(const_float_t start, const_float_t current, const_float_t target);
61 61
   #endif
62 62
 
63 63
   #if HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_HEATED_CHAMBER

+ 1
- 1
Marlin/src/feature/max7219.cpp Просмотреть файл

@@ -256,7 +256,7 @@ void Max7219::set(const uint8_t line, const uint8_t bits) {
256 256
   }
257 257
 
258 258
   // Draw a float with a decimal point and optional digits
259
-  void Max7219::print(const uint8_t start, const float value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) {
259
+  void Max7219::print(const uint8_t start, const_float_t value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false) {
260 260
     if (pre_size) print(start, value, pre_size, leadzero, !!post_size);
261 261
     if (post_size) {
262 262
       const int16_t after = ABS(value) * (10 ^ post_size);

+ 7
- 0
Marlin/src/feature/max7219.h Просмотреть файл

@@ -100,6 +100,13 @@ public:
100 100
   // Update a single native line on just one unit
101 101
   static void refresh_unit_line(const uint8_t line);
102 102
 
103
+  #if ENABLED(MAX7219_NUMERIC)
104
+    // Draw an integer with optional leading zeros and optional decimal point
105
+    void print(const uint8_t start, int16_t value, uint8_t size, const bool leadzero=false, bool dec=false);
106
+    // Draw a float with a decimal point and optional digits
107
+    void print(const uint8_t start, const_float_t value, const uint8_t pre_size, const uint8_t post_size, const bool leadzero=false);
108
+  #endif
109
+
103 110
   // Set a single LED by XY coordinate
104 111
   static void led_set(const uint8_t x, const uint8_t y, const bool on);
105 112
   static void led_on(const uint8_t x, const uint8_t y);

+ 1
- 1
Marlin/src/feature/mixing.cpp Просмотреть файл

@@ -162,7 +162,7 @@ void Mixer::refresh_collector(const float proportion/*=1.0*/, const uint8_t t/*=
162 162
 
163 163
   float Mixer::prev_z; // = 0
164 164
 
165
-  void Mixer::update_gradient_for_z(const float z) {
165
+  void Mixer::update_gradient_for_z(const_float_t z) {
166 166
     if (z == prev_z) return;
167 167
     prev_z = z;
168 168
 

+ 2
- 2
Marlin/src/feature/mixing.h Просмотреть файл

@@ -180,9 +180,9 @@ class Mixer {
180 180
     static float prev_z;
181 181
 
182 182
     // Update the current mix from the gradient for a given Z
183
-    static void update_gradient_for_z(const float z);
183
+    static void update_gradient_for_z(const_float_t z);
184 184
     static void update_gradient_for_planner_z();
185
-    static inline void gradient_control(const float z) {
185
+    static inline void gradient_control(const_float_t z) {
186 186
       if (gradient.enabled) {
187 187
         if (z >= gradient.end_z)
188 188
           T(gradient.end_vtool);

+ 5
- 5
Marlin/src/feature/pause.cpp Просмотреть файл

@@ -170,7 +170,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P
170 170
  *
171 171
  * Returns 'true' if load was completed, 'false' for abort
172 172
  */
173
-bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
173
+bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load_length/*=0*/, const_float_t purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
174 174
                    const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/,
175 175
                    const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/
176 176
                    DXC_ARGS
@@ -298,10 +298,10 @@ inline void disable_active_extruder() {
298 298
  *
299 299
  * Returns 'true' if unload was completed, 'false' for abort
300 300
  */
301
-bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
301
+bool unload_filament(const_float_t unload_length, const bool show_lcd/*=false*/,
302 302
                      const PauseMode mode/*=PAUSE_MODE_PAUSE_PRINT*/
303 303
                      #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
304
-                       , const float &mix_multiplier/*=1.0*/
304
+                       , const_float_t mix_multiplier/*=1.0*/
305 305
                      #endif
306 306
 ) {
307 307
   DEBUG_SECTION(uf, "unload_filament", true);
@@ -367,7 +367,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
367 367
  */
368 368
 uint8_t did_pause_print = 0;
369 369
 
370
-bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) {
370
+bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const_float_t unload_length/*=0*/, const bool show_lcd/*=false*/ DXC_ARGS) {
371 371
   DEBUG_SECTION(pp, "pause_print", true);
372 372
   DEBUG_ECHOLNPAIR("... park.x:", park_point.x, " y:", park_point.y, " z:", park_point.z, " unloadlen:", unload_length, " showlcd:", show_lcd DXC_SAY);
373 373
 
@@ -555,7 +555,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
555 555
  * - Send host action for resume, if configured
556 556
  * - Resume the current SD print job, if any
557 557
  */
558
-void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/, const celsius_t targetTemp/*=0*/ DXC_ARGS) {
558
+void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_length/*=0*/, const_float_t purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/, const celsius_t targetTemp/*=0*/ DXC_ARGS) {
559 559
   DEBUG_SECTION(rp, "resume_print", true);
560 560
   DEBUG_ECHOLNPAIR("... slowlen:", slow_load_length, " fastlen:", fast_load_length, " purgelen:", purge_length, " maxbeep:", max_beep_count, " targetTemp:", targetTemp DXC_SAY);
561 561
 

+ 5
- 5
Marlin/src/feature/pause.h Просмотреть файл

@@ -85,19 +85,19 @@ extern uint8_t did_pause_print;
85 85
   #define DXC_SAY
86 86
 #endif
87 87
 
88
-bool pause_print(const float &retract, const xyz_pos_t &park_point, const float &unload_length=0, const bool show_lcd=false DXC_PARAMS);
88
+bool pause_print(const_float_t retract, const xyz_pos_t &park_point, const_float_t unload_length=0, const bool show_lcd=false DXC_PARAMS);
89 89
 
90 90
 void wait_for_confirmation(const bool is_reload=false, const int8_t max_beep_count=0 DXC_PARAMS);
91 91
 
92
-void resume_print(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=ADVANCED_PAUSE_PURGE_LENGTH,
92
+void resume_print(const_float_t slow_load_length=0, const_float_t fast_load_length=0, const_float_t extrude_length=ADVANCED_PAUSE_PURGE_LENGTH,
93 93
                     const int8_t max_beep_count=0, const celsius_t targetTemp=0 DXC_PARAMS);
94 94
 
95
-bool load_filament(const float &slow_load_length=0, const float &fast_load_length=0, const float &extrude_length=0, const int8_t max_beep_count=0,
95
+bool load_filament(const_float_t slow_load_length=0, const_float_t fast_load_length=0, const_float_t extrude_length=0, const int8_t max_beep_count=0,
96 96
                     const bool show_lcd=false, const bool pause_for_user=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT DXC_PARAMS);
97 97
 
98
-bool unload_filament(const float &unload_length, const bool show_lcd=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT
98
+bool unload_filament(const_float_t unload_length, const bool show_lcd=false, const PauseMode mode=PAUSE_MODE_PAUSE_PRINT
99 99
   #if BOTH(FILAMENT_UNLOAD_ALL_EXTRUDERS, MIXING_EXTRUDER)
100
-    , const float &mix_multiplier=1.0
100
+    , const_float_t mix_multiplier=1.0
101 101
   #endif
102 102
 );
103 103
 

+ 1
- 1
Marlin/src/feature/powerloss.cpp Просмотреть файл

@@ -240,7 +240,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=0*/
240 240
 
241 241
   #if ENABLED(BACKUP_POWER_SUPPLY)
242 242
 
243
-    void PrintJobRecovery::retract_and_lift(const float &zraise) {
243
+    void PrintJobRecovery::retract_and_lift(const_float_t zraise) {
244 244
       #if POWER_LOSS_RETRACT_LEN || POWER_LOSS_ZRAISE
245 245
 
246 246
         gcode.set_relative_mode(true);  // Use relative coordinates

+ 1
- 1
Marlin/src/feature/powerloss.h Просмотреть файл

@@ -199,7 +199,7 @@ class PrintJobRecovery {
199 199
     static void write();
200 200
 
201 201
     #if ENABLED(BACKUP_POWER_SUPPLY)
202
-      static void retract_and_lift(const float &zraise);
202
+      static void retract_and_lift(const_float_t zraise);
203 203
     #endif
204 204
 
205 205
     #if PIN_EXISTS(POWER_LOSS)

+ 4
- 4
Marlin/src/feature/probe_temp_comp.cpp Просмотреть файл

@@ -88,12 +88,12 @@ void ProbeTempComp::print_offsets() {
88 88
   }
89 89
 }
90 90
 
91
-void ProbeTempComp::prepare_new_calibration(const float &init_meas_z) {
91
+void ProbeTempComp::prepare_new_calibration(const_float_t init_meas_z) {
92 92
   calib_idx = 0;
93 93
   init_measurement = init_meas_z;
94 94
 }
95 95
 
96
-void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const float &meas_z) {
96
+void ProbeTempComp::push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z) {
97 97
   switch (tsi) {
98 98
     case TSI_PROBE:
99 99
     case TSI_BED:
@@ -159,12 +159,12 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
159 159
   return true;
160 160
 }
161 161
 
162
-void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const float &temp, float &meas_z) {
162
+void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const_float_t temp, float &meas_z) {
163 163
   if (WITHIN(temp, cali_info[tsi].start_temp, cali_info[tsi].end_temp))
164 164
     meas_z -= get_offset_for_temperature(tsi, temp);
165 165
 }
166 166
 
167
-float ProbeTempComp::get_offset_for_temperature(const TempSensorID tsi, const float &temp) {
167
+float ProbeTempComp::get_offset_for_temperature(const TempSensorID tsi, const_float_t temp) {
168 168
   const uint8_t measurements = cali_info[tsi].measurements;
169 169
   const float start_temp = cali_info[tsi].start_temp,
170 170
                 res_temp = cali_info[tsi].temp_res;

+ 4
- 4
Marlin/src/feature/probe_temp_comp.h Просмотреть файл

@@ -121,10 +121,10 @@ class ProbeTempComp {
121 121
     }
122 122
     static bool set_offset(const TempSensorID tsi, const uint8_t idx, const int16_t offset);
123 123
     static void print_offsets();
124
-    static void prepare_new_calibration(const float &init_meas_z);
125
-    static void push_back_new_measurement(const TempSensorID tsi, const float &meas_z);
124
+    static void prepare_new_calibration(const_float_t init_meas_z);
125
+    static void push_back_new_measurement(const TempSensorID tsi, const_float_t meas_z);
126 126
     static bool finish_calibration(const TempSensorID tsi);
127
-    static void compensate_measurement(const TempSensorID tsi, const float &temp, float &meas_z);
127
+    static void compensate_measurement(const TempSensorID tsi, const_float_t temp, float &meas_z);
128 128
 
129 129
   private:
130 130
     static uint8_t calib_idx;
@@ -135,7 +135,7 @@ class ProbeTempComp {
135 135
      */
136 136
     static float init_measurement;
137 137
 
138
-    static float get_offset_for_temperature(const TempSensorID tsi, const float &temp);
138
+    static float get_offset_for_temperature(const TempSensorID tsi, const_float_t temp);
139 139
 
140 140
     /**
141 141
      * Fit a linear function in measured temperature offsets

+ 1
- 1
Marlin/src/feature/runout.h Просмотреть файл

@@ -101,7 +101,7 @@ class TFilamentMonitor : public FilamentMonitorBase {
101 101
 
102 102
     #if HAS_FILAMENT_RUNOUT_DISTANCE
103 103
       static inline float& runout_distance() { return response.runout_distance_mm; }
104
-      static inline void set_runout_distance(const float &mm) { response.runout_distance_mm = mm; }
104
+      static inline void set_runout_distance(const_float_t mm) { response.runout_distance_mm = mm; }
105 105
     #endif
106 106
 
107 107
     // Handle a block completion. RunoutResponseDelayed uses this to

+ 1
- 1
Marlin/src/feature/spindle_laser.h Просмотреть файл

@@ -53,7 +53,7 @@ public:
53 53
     min_pct = TERN(CUTTER_POWER_RELATIVE, 0, TERN(SPINDLE_FEATURE, round(100.0f * (SPEED_POWER_MIN) / (SPEED_POWER_MAX)), SPEED_POWER_MIN)),
54 54
     max_pct = TERN(SPINDLE_FEATURE, 100, SPEED_POWER_MAX);
55 55
 
56
-  static const inline uint8_t pct_to_ocr(const float pct) { return uint8_t(PCT_TO_PWM(pct)); }
56
+  static const inline uint8_t pct_to_ocr(const_float_t pct) { return uint8_t(PCT_TO_PWM(pct)); }
57 57
 
58 58
   // cpower = configured values (e.g., SPEED_POWER_MAX)
59 59
 

+ 2
- 2
Marlin/src/gcode/bedlevel/G26.cpp Просмотреть файл

@@ -212,7 +212,7 @@ mesh_index_pair find_closest_circle_to_print(const xy_pos_t &pos) {
212 212
   return out_point;
213 213
 }
214 214
 
215
-void move_to(const float &rx, const float &ry, const float &z, const float &e_delta) {
215
+void move_to(const_float_t rx, const_float_t ry, const_float_t z, const_float_t e_delta) {
216 216
   static float last_z = -999.99;
217 217
 
218 218
   const xy_pos_t dest = { rx, ry };
@@ -239,7 +239,7 @@ void move_to(const float &rx, const float &ry, const float &z, const float &e_de
239 239
   prepare_internal_move_to_destination(fr_mm_s);
240 240
 }
241 241
 
242
-FORCE_INLINE void move_to(const xyz_pos_t &where, const float &de) { move_to(where.x, where.y, where.z, de); }
242
+FORCE_INLINE void move_to(const xyz_pos_t &where, const_float_t de) { move_to(where.x, where.y, where.z, de); }
243 243
 
244 244
 void retract_filament(const xyz_pos_t &where) {
245 245
   if (!g26_retracted) { // Only retract if we are not already retracted!

+ 1
- 1
Marlin/src/gcode/calibrate/G33.cpp Просмотреть файл

@@ -93,7 +93,7 @@ void ac_cleanup(TERN_(HAS_MULTI_HOTEND, const uint8_t old_tool_index)) {
93 93
   TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index, true));
94 94
 }
95 95
 
96
-void print_signed_float(PGM_P const prefix, const float &f) {
96
+void print_signed_float(PGM_P const prefix, const_float_t f) {
97 97
   SERIAL_ECHOPGM("  ");
98 98
   SERIAL_ECHOPGM_P(prefix);
99 99
   SERIAL_CHAR(':');

+ 1
- 1
Marlin/src/gcode/calibrate/G34_M422.cpp Просмотреть файл

@@ -312,7 +312,7 @@ void GcodeSuite::G34() {
312 312
           ui.set_status(msg);
313 313
         #endif
314 314
 
315
-        auto decreasing_accuracy = [](const float &v1, const float &v2){
315
+        auto decreasing_accuracy = [](const_float_t v1, const_float_t v2){
316 316
           if (v1 < v2 * 0.7f) {
317 317
             SERIAL_ECHOLNPGM("Decreasing Accuracy Detected.");
318 318
             LCD_MESSAGEPGM(MSG_DECREASING_ACCURACY);

+ 1
- 1
Marlin/src/gcode/calibrate/M48.cpp Просмотреть файл

@@ -117,7 +117,7 @@ void GcodeSuite::M48() {
117 117
         max = -99999.9, // Largest value sampled so far
118 118
         sample_set[n_samples];  // Storage for sampled values
119 119
 
120
-  auto dev_report = [](const bool verbose, const float &mean, const float &sigma, const float &min, const float &max, const bool final=false) {
120
+  auto dev_report = [](const bool verbose, const_float_t mean, const_float_t sigma, const_float_t min, const_float_t max, const bool final=false) {
121 121
     if (verbose) {
122 122
       SERIAL_ECHOPAIR_F("Mean: ", mean, 6);
123 123
       if (!final) SERIAL_ECHOPAIR_F(" Sigma: ", sigma, 6);

+ 1
- 1
Marlin/src/gcode/feature/camera/M240.cpp Просмотреть файл

@@ -47,7 +47,7 @@
47 47
   #endif
48 48
 
49 49
   #ifdef PHOTO_RETRACT_MM
50
-    inline void e_move_m240(const float length, const feedRate_t &fr_mm_s) {
50
+    inline void e_move_m240(const float length, const_feedRate_t fr_mm_s) {
51 51
       if (length && thermalManager.hotEnoughToExtrude(active_extruder))
52 52
         unscaled_e_move(length, fr_mm_s);
53 53
     }

+ 1
- 1
Marlin/src/gcode/feature/mixing/M166.cpp Просмотреть файл

@@ -33,7 +33,7 @@ inline void echo_mix() {
33 33
   SERIAL_ECHOPAIR(" (", mixer.mix[0], "%|", mixer.mix[1], "%)");
34 34
 }
35 35
 
36
-inline void echo_zt(const int t, const float &z) {
36
+inline void echo_zt(const int t, const_float_t z) {
37 37
   mixer.update_mix_from_vtool(t);
38 38
   SERIAL_ECHOPAIR_P(SP_Z_STR, z, SP_T_STR, t);
39 39
   echo_mix();

+ 1
- 1
Marlin/src/gcode/motion/M290.cpp Просмотреть файл

@@ -39,7 +39,7 @@
39 39
 
40 40
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET)
41 41
 
42
-  FORCE_INLINE void mod_probe_offset(const float &offs) {
42
+  FORCE_INLINE void mod_probe_offset(const_float_t offs) {
43 43
     if (TERN1(BABYSTEP_HOTEND_Z_OFFSET, active_extruder == 0)) {
44 44
       probe.offset.z += offs;
45 45
       SERIAL_ECHO_MSG(STR_PROBE_OFFSET " " STR_Z, probe.offset.z);

+ 6
- 6
Marlin/src/gcode/parser.h Просмотреть файл

@@ -282,8 +282,8 @@ public:
282 282
   // Units modes: Inches, Fahrenheit, Kelvin
283 283
 
284 284
   #if ENABLED(INCH_MODE_SUPPORT)
285
-    static inline float mm_to_linear_unit(const float mm)     { return mm / linear_unit_factor; }
286
-    static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); }
285
+    static inline float mm_to_linear_unit(const_float_t mm)     { return mm / linear_unit_factor; }
286
+    static inline float mm_to_volumetric_unit(const_float_t mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); }
287 287
 
288 288
     // Init linear units by constructor
289 289
     GCodeParser() { set_input_linear_units(LINEARUNIT_MM); }
@@ -301,16 +301,16 @@ public:
301 301
       return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
302 302
     }
303 303
 
304
-    static inline float linear_value_to_mm(const float v)                    { return v * linear_unit_factor; }
304
+    static inline float linear_value_to_mm(const_float_t v)                  { return v * linear_unit_factor; }
305 305
     static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); }
306 306
     static inline float per_axis_value(const AxisEnum axis, const float v)   { return v / axis_unit_factor(axis); }
307 307
 
308 308
   #else
309 309
 
310
-    static inline float mm_to_linear_unit(const float mm)     { return mm; }
311
-    static inline float mm_to_volumetric_unit(const float mm) { return mm; }
310
+    static inline float mm_to_linear_unit(const_float_t mm)     { return mm; }
311
+    static inline float mm_to_volumetric_unit(const_float_t mm) { return mm; }
312 312
 
313
-    static inline float linear_value_to_mm(const float v)               { return v; }
313
+    static inline float linear_value_to_mm(const_float_t v)             { return v; }
314 314
     static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; }
315 315
     static inline float per_axis_value(const AxisEnum, const float v)   { return v; }
316 316
 

+ 1
- 1
Marlin/src/lcd/dogm/marlinui_DOGM.cpp Просмотреть файл

@@ -669,7 +669,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
669 669
       B00001100,B00000000
670 670
     };
671 671
 
672
-    void _lcd_zoffset_overlay_gfx(const float zvalue) {
672
+    void _lcd_zoffset_overlay_gfx(const_float_t zvalue) {
673 673
       // Determine whether the user is raising or lowering the nozzle.
674 674
       static int8_t dir;
675 675
       static float old_zvalue;

+ 1
- 1
Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp Просмотреть файл

@@ -101,7 +101,7 @@ namespace ExtUI {
101 101
   #if HAS_MESH
102 102
     void onMeshLevelingStart() {}
103 103
 
104
-    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval) {
104
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
105 105
       // Called when any mesh points are updated
106 106
       //SERIAL_ECHOLNPAIR("onMeshUpdate() x:", xpos, " y:", ypos, " z:", zval);
107 107
     }

+ 1
- 1
Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp Просмотреть файл

@@ -93,7 +93,7 @@ namespace ExtUI {
93 93
 
94 94
     void onMeshLevelingStart() {}
95 95
 
96
-    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval) {
96
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
97 97
       // Called when any mesh points are updated
98 98
     }
99 99
   #endif

+ 1
- 1
Marlin/src/lcd/extui/dgus_lcd.cpp Просмотреть файл

@@ -111,7 +111,7 @@ namespace ExtUI {
111 111
   #if HAS_MESH
112 112
     void onMeshLevelingStart() {}
113 113
 
114
-    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval) {
114
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
115 115
       // Called when any mesh points are updated
116 116
     }
117 117
 

+ 1
- 1
Marlin/src/lcd/extui/example.cpp Просмотреть файл

@@ -97,7 +97,7 @@ namespace ExtUI {
97 97
   #if HAS_MESH
98 98
     void onMeshLevelingStart() {}
99 99
 
100
-    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval) {
100
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
101 101
       // Called when any mesh points are updated
102 102
     }
103 103
 

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp Просмотреть файл

@@ -140,7 +140,7 @@ namespace ExtUI {
140 140
   #if HAS_LEVELING && HAS_MESH
141 141
     void onMeshLevelingStart() {}
142 142
 
143
-    void onMeshUpdate(const int8_t x, const int8_t y, const float &val) {
143
+    void onMeshUpdate(const int8_t x, const int8_t y, const_float_t val) {
144 144
       BedMeshScreen::onMeshUpdate(x, y, val);
145 145
     }
146 146
 

+ 1
- 1
Marlin/src/lcd/extui/malyan_lcd.cpp Просмотреть файл

@@ -528,7 +528,7 @@ namespace ExtUI {
528 528
 
529 529
   #if HAS_MESH
530 530
     void onMeshLevelingStart() {}
531
-    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval) {}
531
+    void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {}
532 532
     void onMeshUpdate(const int8_t xpos, const int8_t ypos, const ExtUI::probe_state_t state) {}
533 533
   #endif
534 534
 

+ 35
- 35
Marlin/src/lcd/extui/ui_api.cpp Просмотреть файл

@@ -325,7 +325,7 @@ namespace ExtUI {
325 325
     return epos;
326 326
   }
327 327
 
328
-  void setAxisPosition_mm(const float &position, const axis_t axis, const feedRate_t feedrate/*=0*/) {
328
+  void setAxisPosition_mm(const_float_t position, const axis_t axis, const feedRate_t feedrate/*=0*/) {
329 329
     // Get motion limit from software endstops, if any
330 330
     float min, max;
331 331
     soft_endstop.get_manual_axis_limits((AxisEnum)axis, min, max);
@@ -343,7 +343,7 @@ namespace ExtUI {
343 343
     line_to_current_position(feedrate ?: manual_feedrate_mm_s[axis]);
344 344
   }
345 345
 
346
-  void setAxisPosition_mm(const float &position, const extruder_t extruder, const feedRate_t feedrate/*=0*/) {
346
+  void setAxisPosition_mm(const_float_t position, const extruder_t extruder, const feedRate_t feedrate/*=0*/) {
347 347
     setActiveTool(extruder, true);
348 348
 
349 349
     current_position.e = position;
@@ -455,7 +455,7 @@ namespace ExtUI {
455 455
       };
456 456
     }
457 457
 
458
-    void setAxisCurrent_mA(const float &mA, const axis_t axis) {
458
+    void setAxisCurrent_mA(const_float_t mA, const axis_t axis) {
459 459
       switch (axis) {
460 460
         #if AXIS_IS_TMC(X)
461 461
           case X: stepperX.rms_current(constrain(mA, 400, 1500)); break;
@@ -479,7 +479,7 @@ namespace ExtUI {
479 479
       };
480 480
     }
481 481
 
482
-    void setAxisCurrent_mA(const float &mA, const extruder_t extruder) {
482
+    void setAxisCurrent_mA(const_float_t mA, const extruder_t extruder) {
483 483
       switch (extruder) {
484 484
         #if AXIS_IS_TMC(E0)
485 485
           case E0: stepperE0.rms_current(constrain(mA, 400, 1500)); break;
@@ -539,7 +539,7 @@ namespace ExtUI {
539 539
       }
540 540
     }
541 541
 
542
-    void setTMCBumpSensitivity(const float &value, const axis_t axis) {
542
+    void setTMCBumpSensitivity(const_float_t value, const axis_t axis) {
543 543
       switch (axis) {
544 544
         #if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
545 545
           #if X_SENSORLESS
@@ -583,12 +583,12 @@ namespace ExtUI {
583 583
     return planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)];
584 584
   }
585 585
 
586
-  void setAxisSteps_per_mm(const float &value, const axis_t axis) {
586
+  void setAxisSteps_per_mm(const_float_t value, const axis_t axis) {
587 587
     planner.settings.axis_steps_per_mm[axis] = value;
588 588
     planner.refresh_positioning();
589 589
   }
590 590
 
591
-  void setAxisSteps_per_mm(const float &value, const extruder_t extruder) {
591
+  void setAxisSteps_per_mm(const_float_t value, const extruder_t extruder) {
592 592
     UNUSED_E(extruder);
593 593
     planner.settings.axis_steps_per_mm[E_AXIS_N(extruder - E0)] = value;
594 594
     planner.refresh_positioning();
@@ -621,11 +621,11 @@ namespace ExtUI {
621 621
     return planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(extruder - E0)];
622 622
   }
623 623
 
624
-  void setAxisMaxAcceleration_mm_s2(const float &value, const axis_t axis) {
624
+  void setAxisMaxAcceleration_mm_s2(const_float_t value, const axis_t axis) {
625 625
     planner.set_max_acceleration(axis, value);
626 626
   }
627 627
 
628
-  void setAxisMaxAcceleration_mm_s2(const float &value, const extruder_t extruder) {
628
+  void setAxisMaxAcceleration_mm_s2(const_float_t value, const extruder_t extruder) {
629 629
     UNUSED_E(extruder);
630 630
     planner.set_max_acceleration(E_AXIS_N(extruder - E0), value);
631 631
   }
@@ -638,7 +638,7 @@ namespace ExtUI {
638 638
 
639 639
     #if HAS_FILAMENT_RUNOUT_DISTANCE
640 640
       float getFilamentRunoutDistance_mm()                 { return runout.runout_distance(); }
641
-      void setFilamentRunoutDistance_mm(const float &value) { runout.set_runout_distance(constrain(value, 0, 999)); }
641
+      void setFilamentRunoutDistance_mm(const_float_t value) { runout.set_runout_distance(constrain(value, 0, 999)); }
642 642
     #endif
643 643
   #endif
644 644
 
@@ -651,7 +651,7 @@ namespace ExtUI {
651 651
 
652 652
     #if CASELIGHT_USES_BRIGHTNESS
653 653
       float getCaseLightBrightness_percent()                 { return ui8_to_percent(caselight.brightness); }
654
-      void setCaseLightBrightness_percent(const float &value) {
654
+      void setCaseLightBrightness_percent(const_float_t value) {
655 655
          caselight.brightness = map(constrain(value, 0, 100), 0, 100, 0, 255);
656 656
          caselight.update_brightness();
657 657
       }
@@ -663,7 +663,7 @@ namespace ExtUI {
663 663
       return (extruder < EXTRUDERS) ? planner.extruder_advance_K[extruder - E0] : 0;
664 664
     }
665 665
 
666
-    void setLinearAdvance_mm_mm_s(const float &value, const extruder_t extruder) {
666
+    void setLinearAdvance_mm_mm_s(const_float_t value, const extruder_t extruder) {
667 667
       if (extruder < EXTRUDERS)
668 668
         planner.extruder_advance_K[extruder - E0] = constrain(value, 0, 10);
669 669
     }
@@ -675,7 +675,7 @@ namespace ExtUI {
675 675
       return planner.junction_deviation_mm;
676 676
     }
677 677
 
678
-    void setJunctionDeviation_mm(const float &value) {
678
+    void setJunctionDeviation_mm(const_float_t value) {
679 679
       planner.junction_deviation_mm = constrain(value, 0.001, 0.3);
680 680
       TERN_(LIN_ADVANCE, planner.recalculate_max_e_jerk());
681 681
     }
@@ -683,8 +683,8 @@ namespace ExtUI {
683 683
   #else
684 684
     float getAxisMaxJerk_mm_s(const axis_t axis) { return planner.max_jerk[axis]; }
685 685
     float getAxisMaxJerk_mm_s(const extruder_t) { return planner.max_jerk.e; }
686
-    void setAxisMaxJerk_mm_s(const float &value, const axis_t axis) { planner.set_max_jerk((AxisEnum)axis, value); }
687
-    void setAxisMaxJerk_mm_s(const float &value, const extruder_t) { planner.set_max_jerk(E_AXIS, value); }
686
+    void setAxisMaxJerk_mm_s(const_float_t value, const axis_t axis) { planner.set_max_jerk((AxisEnum)axis, value); }
687
+    void setAxisMaxJerk_mm_s(const_float_t value, const extruder_t) { planner.set_max_jerk(E_AXIS, value); }
688 688
   #endif
689 689
 
690 690
   #if ENABLED(DUAL_X_CARRIAGE)
@@ -709,9 +709,9 @@ namespace ExtUI {
709 709
   void setFlow_percent(const int16_t flow, const extruder_t extr) { planner.set_flow(extr, flow); }
710 710
   void setMinFeedrate_mm_s(const feedRate_t fr)       { planner.settings.min_feedrate_mm_s = fr; }
711 711
   void setMinTravelFeedrate_mm_s(const feedRate_t fr) { planner.settings.min_travel_feedrate_mm_s = fr; }
712
-  void setPrintingAcceleration_mm_s2(const float &acc) { planner.settings.acceleration = acc; }
713
-  void setRetractAcceleration_mm_s2(const float &acc) { planner.settings.retract_acceleration = acc; }
714
-  void setTravelAcceleration_mm_s2(const float &acc)  { planner.settings.travel_acceleration = acc; }
712
+  void setPrintingAcceleration_mm_s2(const_float_t acc) { planner.settings.acceleration = acc; }
713
+  void setRetractAcceleration_mm_s2(const_float_t acc) { planner.settings.retract_acceleration = acc; }
714
+  void setTravelAcceleration_mm_s2(const_float_t acc)  { planner.settings.travel_acceleration = acc; }
715 715
 
716 716
   #if ENABLED(BABYSTEPPING)
717 717
 
@@ -772,7 +772,7 @@ namespace ExtUI {
772 772
      * Converts a mm displacement to a number of whole number of
773 773
      * steps that is at least mm long.
774 774
      */
775
-    int16_t mmToWholeSteps(const float &mm, const axis_t axis) {
775
+    int16_t mmToWholeSteps(const_float_t mm, const axis_t axis) {
776 776
       const float steps = mm / planner.steps_to_mm[axis];
777 777
       return steps > 0 ? CEIL(steps) : FLOOR(steps);
778 778
     }
@@ -789,7 +789,7 @@ namespace ExtUI {
789 789
     );
790 790
   }
791 791
 
792
-  void setZOffset_mm(const float &value) {
792
+  void setZOffset_mm(const_float_t value) {
793 793
     #if HAS_BED_PROBE
794 794
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
795 795
         probe.offset.z = value;
@@ -807,7 +807,7 @@ namespace ExtUI {
807 807
       return hotend_offset[extruder - E0][axis];
808 808
     }
809 809
 
810
-    void setNozzleOffset_mm(const float &value, const axis_t axis, const extruder_t extruder) {
810
+    void setNozzleOffset_mm(const_float_t value, const axis_t axis, const extruder_t extruder) {
811 811
       if (extruder - E0 >= HOTENDS) return;
812 812
       hotend_offset[extruder - E0][axis] = value;
813 813
     }
@@ -826,20 +826,20 @@ namespace ExtUI {
826 826
 
827 827
   #if HAS_BED_PROBE
828 828
     float getProbeOffset_mm(const axis_t axis) { return probe.offset.pos[axis]; }
829
-    void setProbeOffset_mm(const float &val, const axis_t axis) { probe.offset.pos[axis] = val; }
829
+    void setProbeOffset_mm(const_float_t val, const axis_t axis) { probe.offset.pos[axis] = val; }
830 830
   #endif
831 831
 
832 832
   #if ENABLED(BACKLASH_GCODE)
833 833
     float getAxisBacklash_mm(const axis_t axis)       { return backlash.distance_mm[axis]; }
834
-    void setAxisBacklash_mm(const float &value, const axis_t axis)
834
+    void setAxisBacklash_mm(const_float_t value, const axis_t axis)
835 835
                                                       { backlash.distance_mm[axis] = constrain(value,0,5); }
836 836
 
837 837
     float getBacklashCorrection_percent()             { return ui8_to_percent(backlash.correction); }
838
-    void setBacklashCorrection_percent(const float &value) { backlash.correction = map(constrain(value, 0, 100), 0, 100, 0, 255); }
838
+    void setBacklashCorrection_percent(const_float_t value) { backlash.correction = map(constrain(value, 0, 100), 0, 100, 0, 255); }
839 839
 
840 840
     #ifdef BACKLASH_SMOOTHING_MM
841 841
       float getBacklashSmoothing_mm()                 { return backlash.smoothing_mm; }
842
-      void setBacklashSmoothing_mm(const float &value) { backlash.smoothing_mm = constrain(value, 0, 999); }
842
+      void setBacklashSmoothing_mm(const_float_t value) { backlash.smoothing_mm = constrain(value, 0, 999); }
843 843
     #endif
844 844
   #endif
845 845
 
@@ -858,14 +858,14 @@ namespace ExtUI {
858 858
 
859 859
       bed_mesh_t& getMeshArray() { return Z_VALUES_ARR; }
860 860
       float getMeshPoint(const xy_uint8_t &pos) { return Z_VALUES(pos.x, pos.y); }
861
-      void setMeshPoint(const xy_uint8_t &pos, const float &zoff) {
861
+      void setMeshPoint(const xy_uint8_t &pos, const_float_t zoff) {
862 862
         if (WITHIN(pos.x, 0, GRID_MAX_POINTS_X) && WITHIN(pos.y, 0, GRID_MAX_POINTS_Y)) {
863 863
           Z_VALUES(pos.x, pos.y) = zoff;
864 864
           TERN_(ABL_BILINEAR_SUBDIVISION, bed_level_virt_interpolate());
865 865
         }
866 866
       }
867 867
 
868
-      void moveToMeshPoint(const xy_uint8_t &pos, const float &z) {
868
+      void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z) {
869 869
         #if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)
870 870
           const feedRate_t old_feedrate = feedrate_mm_s;
871 871
           const float x_target = MESH_MIN_X + pos.x * (MESH_X_DIST),
@@ -919,14 +919,14 @@ namespace ExtUI {
919 919
     float getPIDValues_Ki(const extruder_t tool) { return unscalePID_i(PID_PARAM(Ki, tool)); }
920 920
     float getPIDValues_Kd(const extruder_t tool) { return unscalePID_d(PID_PARAM(Kd, tool)); }
921 921
 
922
-    void setPIDValues(const float &p, const float &i, const float &d, extruder_t tool) {
922
+    void setPIDValues(const_float_t p, const_float_t i, const_float_t d, extruder_t tool) {
923 923
       thermalManager.temp_hotend[tool].pid.Kp = p;
924 924
       thermalManager.temp_hotend[tool].pid.Ki = scalePID_i(i);
925 925
       thermalManager.temp_hotend[tool].pid.Kd = scalePID_d(d);
926 926
       thermalManager.updatePID();
927 927
     }
928 928
 
929
-    void startPIDTune(const float &temp, extruder_t tool) {
929
+    void startPIDTune(const_float_t temp, extruder_t tool) {
930 930
       thermalManager.PID_autotune(temp, (heater_id_t)tool, 8, true);
931 931
     }
932 932
   #endif
@@ -936,14 +936,14 @@ namespace ExtUI {
936 936
     float getBedPIDValues_Ki() { return unscalePID_i(thermalManager.temp_bed.pid.Ki); }
937 937
     float getBedPIDValues_Kd() { return unscalePID_d(thermalManager.temp_bed.pid.Kd); }
938 938
 
939
-    void setBedPIDValues(const float &p, const float &i, const float &d) {
939
+    void setBedPIDValues(const_float_t p, const_float_t i, const_float_t d) {
940 940
       thermalManager.temp_bed.pid.Kp = p;
941 941
       thermalManager.temp_bed.pid.Ki = scalePID_i(i);
942 942
       thermalManager.temp_bed.pid.Kd = scalePID_d(d);
943 943
       thermalManager.updatePID();
944 944
     }
945 945
 
946
-    void startBedPIDTune(const float &temp) {
946
+    void startBedPIDTune(const_float_t temp) {
947 947
       thermalManager.PID_autotune(temp, H_BED, 4, true);
948 948
     }
949 949
   #endif
@@ -963,7 +963,7 @@ namespace ExtUI {
963 963
     return firmware_name;
964 964
   }
965 965
 
966
-  void setTargetTemp_celsius(const float &inval, const heater_t heater) {
966
+  void setTargetTemp_celsius(const_float_t inval, const heater_t heater) {
967 967
     float value = inval;
968 968
     #ifdef TOUCH_UI_LCD_TEMP_SCALING
969 969
       value *= TOUCH_UI_LCD_TEMP_SCALING;
@@ -988,7 +988,7 @@ namespace ExtUI {
988 988
     }
989 989
   }
990 990
 
991
-  void setTargetTemp_celsius(const float &inval, const extruder_t extruder) {
991
+  void setTargetTemp_celsius(const_float_t inval, const extruder_t extruder) {
992 992
     float value = inval;
993 993
     #ifdef TOUCH_UI_LCD_TEMP_SCALING
994 994
       value *= TOUCH_UI_LCD_TEMP_SCALING;
@@ -1000,7 +1000,7 @@ namespace ExtUI {
1000 1000
     #endif
1001 1001
   }
1002 1002
 
1003
-  void setTargetFan_percent(const float &value, const fan_t fan) {
1003
+  void setTargetFan_percent(const_float_t value, const fan_t fan) {
1004 1004
     #if HAS_FAN
1005 1005
       if (fan < FAN_COUNT)
1006 1006
         thermalManager.set_fan_speed(fan - FAN0, map(constrain(value, 0, 100), 0, 100, 0, 255));
@@ -1010,7 +1010,7 @@ namespace ExtUI {
1010 1010
     #endif
1011 1011
   }
1012 1012
 
1013
-  void setFeedrate_percent(const float &value) { feedrate_percentage = constrain(value, 10, 500); }
1013
+  void setFeedrate_percent(const_float_t value) { feedrate_percentage = constrain(value, 10, 500); }
1014 1014
 
1015 1015
   void coolDown() {
1016 1016
     #if HAS_HOTEND

+ 37
- 37
Marlin/src/lcd/extui/ui_api.h Просмотреть файл

@@ -102,11 +102,11 @@ namespace ExtUI {
102 102
   #if HAS_TRINAMIC_CONFIG
103 103
     float getAxisCurrent_mA(const axis_t);
104 104
     float getAxisCurrent_mA(const extruder_t);
105
-    void  setAxisCurrent_mA(const float&, const axis_t);
106
-    void  setAxisCurrent_mA(const float&, const extruder_t);
105
+    void  setAxisCurrent_mA(const_float_t , const axis_t);
106
+    void  setAxisCurrent_mA(const_float_t , const extruder_t);
107 107
 
108 108
      int getTMCBumpSensitivity(const axis_t);
109
-    void setTMCBumpSensitivity(const float&, const axis_t);
109
+    void setTMCBumpSensitivity(const_float_t , const axis_t);
110 110
   #endif
111 111
 
112 112
   float getActualTemp_celsius(const heater_t);
@@ -161,11 +161,11 @@ namespace ExtUI {
161 161
     #if HAS_MESH
162 162
       bed_mesh_t& getMeshArray();
163 163
       float getMeshPoint(const xy_uint8_t &pos);
164
-      void setMeshPoint(const xy_uint8_t &pos, const float &zval);
165
-      void moveToMeshPoint(const xy_uint8_t &pos, const float &z);
164
+      void setMeshPoint(const xy_uint8_t &pos, const_float_t zval);
165
+      void moveToMeshPoint(const xy_uint8_t &pos, const_float_t z);
166 166
       void onMeshLevelingStart();
167
-      void onMeshUpdate(const int8_t xpos, const int8_t ypos, const float &zval);
168
-      inline void onMeshUpdate(const xy_int8_t &pos, const float &zval) { onMeshUpdate(pos.x, pos.y, zval); }
167
+      void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval);
168
+      inline void onMeshUpdate(const xy_int8_t &pos, const_float_t zval) { onMeshUpdate(pos.x, pos.y, zval); }
169 169
 
170 170
       typedef enum : uint8_t {
171 171
         MESH_START,    // Prior to start of probe
@@ -191,42 +191,42 @@ namespace ExtUI {
191 191
     char* getFilamentUsed_str(char buffer[21]);
192 192
   #endif
193 193
 
194
-  void setTargetTemp_celsius(const float&, const heater_t);
195
-  void setTargetTemp_celsius(const float&, const extruder_t);
196
-  void setTargetFan_percent(const float&, const fan_t);
194
+  void setTargetTemp_celsius(const_float_t , const heater_t);
195
+  void setTargetTemp_celsius(const_float_t , const extruder_t);
196
+  void setTargetFan_percent(const_float_t , const fan_t);
197 197
   void coolDown();
198
-  void setAxisPosition_mm(const float&, const axis_t, const feedRate_t=0);
199
-  void setAxisPosition_mm(const float&, const extruder_t, const feedRate_t=0);
200
-  void setAxisSteps_per_mm(const float&, const axis_t);
201
-  void setAxisSteps_per_mm(const float&, const extruder_t);
198
+  void setAxisPosition_mm(const_float_t , const axis_t, const feedRate_t=0);
199
+  void setAxisPosition_mm(const_float_t , const extruder_t, const feedRate_t=0);
200
+  void setAxisSteps_per_mm(const_float_t , const axis_t);
201
+  void setAxisSteps_per_mm(const_float_t , const extruder_t);
202 202
   void setAxisMaxFeedrate_mm_s(const feedRate_t, const axis_t);
203 203
   void setAxisMaxFeedrate_mm_s(const feedRate_t, const extruder_t);
204
-  void setAxisMaxAcceleration_mm_s2(const float&, const axis_t);
205
-  void setAxisMaxAcceleration_mm_s2(const float&, const extruder_t);
204
+  void setAxisMaxAcceleration_mm_s2(const_float_t , const axis_t);
205
+  void setAxisMaxAcceleration_mm_s2(const_float_t , const extruder_t);
206 206
   void setFeedrate_mm_s(const feedRate_t);
207 207
   void setMinFeedrate_mm_s(const feedRate_t);
208 208
   void setMinTravelFeedrate_mm_s(const feedRate_t);
209
-  void setPrintingAcceleration_mm_s2(const float&);
210
-  void setRetractAcceleration_mm_s2(const float&);
211
-  void setTravelAcceleration_mm_s2(const float&);
212
-  void setFeedrate_percent(const float&);
209
+  void setPrintingAcceleration_mm_s2(const_float_t );
210
+  void setRetractAcceleration_mm_s2(const_float_t );
211
+  void setTravelAcceleration_mm_s2(const_float_t );
212
+  void setFeedrate_percent(const_float_t );
213 213
   void setFlow_percent(const int16_t, const extruder_t);
214 214
   bool awaitingUserConfirm();
215 215
   void setUserConfirmed();
216 216
 
217 217
   #if ENABLED(LIN_ADVANCE)
218 218
     float getLinearAdvance_mm_mm_s(const extruder_t);
219
-    void setLinearAdvance_mm_mm_s(const float&, const extruder_t);
219
+    void setLinearAdvance_mm_mm_s(const_float_t , const extruder_t);
220 220
   #endif
221 221
 
222 222
   #if HAS_JUNCTION_DEVIATION
223 223
     float getJunctionDeviation_mm();
224
-    void setJunctionDeviation_mm(const float&);
224
+    void setJunctionDeviation_mm(const_float_t );
225 225
   #else
226 226
     float getAxisMaxJerk_mm_s(const axis_t);
227 227
     float getAxisMaxJerk_mm_s(const extruder_t);
228
-    void setAxisMaxJerk_mm_s(const float&, const axis_t);
229
-    void setAxisMaxJerk_mm_s(const float&, const extruder_t);
228
+    void setAxisMaxJerk_mm_s(const_float_t , const axis_t);
229
+    void setAxisMaxJerk_mm_s(const_float_t , const extruder_t);
230 230
   #endif
231 231
 
232 232
   extruder_t getTool(const uint8_t extruder);
@@ -234,7 +234,7 @@ namespace ExtUI {
234 234
   void setActiveTool(const extruder_t, bool no_move);
235 235
 
236 236
   #if ENABLED(BABYSTEPPING)
237
-    int16_t mmToWholeSteps(const float& mm, const axis_t axis);
237
+    int16_t mmToWholeSteps(const_float_t mm, const axis_t axis);
238 238
 
239 239
     bool babystepAxis_steps(const int16_t steps, const axis_t axis);
240 240
     void smartAdjustAxis_steps(const int16_t steps, const axis_t axis, bool linked_nozzles);
@@ -242,28 +242,28 @@ namespace ExtUI {
242 242
 
243 243
   #if HAS_HOTEND_OFFSET
244 244
     float getNozzleOffset_mm(const axis_t, const extruder_t);
245
-    void setNozzleOffset_mm(const float&, const axis_t, const extruder_t);
245
+    void setNozzleOffset_mm(const_float_t , const axis_t, const extruder_t);
246 246
     void normalizeNozzleOffset(const axis_t axis);
247 247
   #endif
248 248
 
249 249
   float getZOffset_mm();
250
-  void setZOffset_mm(const float&);
250
+  void setZOffset_mm(const_float_t );
251 251
 
252 252
   #if HAS_BED_PROBE
253 253
     float getProbeOffset_mm(const axis_t);
254
-    void setProbeOffset_mm(const float&, const axis_t);
254
+    void setProbeOffset_mm(const_float_t , const axis_t);
255 255
   #endif
256 256
 
257 257
   #if ENABLED(BACKLASH_GCODE)
258 258
     float getAxisBacklash_mm(const axis_t);
259
-    void setAxisBacklash_mm(const float&, const axis_t);
259
+    void setAxisBacklash_mm(const_float_t , const axis_t);
260 260
 
261 261
     float getBacklashCorrection_percent();
262
-    void setBacklashCorrection_percent(const float&);
262
+    void setBacklashCorrection_percent(const_float_t );
263 263
 
264 264
     #ifdef BACKLASH_SMOOTHING_MM
265 265
       float getBacklashSmoothing_mm();
266
-      void setBacklashSmoothing_mm(const float&);
266
+      void setBacklashSmoothing_mm(const_float_t );
267 267
     #endif
268 268
   #endif
269 269
 
@@ -275,7 +275,7 @@ namespace ExtUI {
275 275
 
276 276
     #if HAS_FILAMENT_RUNOUT_DISTANCE
277 277
       float getFilamentRunoutDistance_mm();
278
-      void setFilamentRunoutDistance_mm(const float&);
278
+      void setFilamentRunoutDistance_mm(const_float_t );
279 279
     #endif
280 280
   #endif
281 281
 
@@ -285,7 +285,7 @@ namespace ExtUI {
285 285
 
286 286
     #if DISABLED(CASE_LIGHT_NO_BRIGHTNESS)
287 287
       float getCaseLightBrightness_percent();
288
-      void setCaseLightBrightness_percent(const float&);
288
+      void setCaseLightBrightness_percent(const_float_t );
289 289
     #endif
290 290
   #endif
291 291
 
@@ -293,16 +293,16 @@ namespace ExtUI {
293 293
     float getPIDValues_Kp(const extruder_t);
294 294
     float getPIDValues_Ki(const extruder_t);
295 295
     float getPIDValues_Kd(const extruder_t);
296
-    void setPIDValues(const float&, const float&, const float&, extruder_t);
297
-    void startPIDTune(const float&, extruder_t);
296
+    void setPIDValues(const_float_t , const_float_t , const_float_t , extruder_t);
297
+    void startPIDTune(const_float_t , extruder_t);
298 298
   #endif
299 299
 
300 300
   #if ENABLED(PIDTEMPBED)
301 301
     float getBedPIDValues_Kp();
302 302
     float getBedPIDValues_Ki();
303 303
     float getBedPIDValues_Kd();
304
-    void setBedPIDValues(const float&, const float&, const float&);
305
-    void startBedPIDTune(const float&);
304
+    void setBedPIDValues(const_float_t , const_float_t , const_float_t );
305
+    void startBedPIDTune(const_float_t );
306 306
   #endif
307 307
 
308 308
   /**

+ 1
- 1
Marlin/src/lcd/marlinui.h Просмотреть файл

@@ -501,7 +501,7 @@ public:
501 501
     #endif
502 502
 
503 503
     #if ENABLED(AUTO_BED_LEVELING_UBL)
504
-      static void ubl_mesh_edit_start(const float &initial);
504
+      static void ubl_mesh_edit_start(const_float_t initial);
505 505
       static float ubl_mesh_value();
506 506
     #endif
507 507
 

+ 1
- 1
Marlin/src/lcd/menu/menu.cpp Просмотреть файл

@@ -289,7 +289,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
289 289
 
290 290
 #if HAS_LINE_TO_Z
291 291
 
292
-  void line_to_z(const float &z) {
292
+  void line_to_z(const_float_t z) {
293 293
     current_position.z = z;
294 294
     line_to_current_position(manual_feedrate_mm_s.z);
295 295
   }

+ 2
- 6
Marlin/src/lcd/menu/menu.h Просмотреть файл

@@ -40,7 +40,7 @@ typedef void (*selectFunc_t)();
40 40
 #define SS_DEFAULT SS_CENTER
41 41
 
42 42
 #if HAS_MARLINUI_U8GLIB && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
43
-  void _lcd_zoffset_overlay_gfx(const float zvalue);
43
+  void _lcd_zoffset_overlay_gfx(const_float_t zvalue);
44 44
 #endif
45 45
 
46 46
 #if ENABLED(BABYSTEP_ZPROBE_OFFSET) && Z_PROBE_OFFSET_RANGE_MIN >= -9 && Z_PROBE_OFFSET_RANGE_MAX <= 9
@@ -212,11 +212,7 @@ void _lcd_draw_homing();
212 212
 #define HAS_LINE_TO_Z ANY(DELTA, PROBE_MANUALLY, MESH_BED_LEVELING, LEVEL_BED_CORNERS)
213 213
 
214 214
 #if HAS_LINE_TO_Z
215
-  void line_to_z(const float &z);
216
-#endif
217
-
218
-#if HAS_MARLINUI_U8GLIB && EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
219
-  void _lcd_zoffset_overlay_gfx(const float zvalue);
215
+  void line_to_z(const_float_t z);
220 216
 #endif
221 217
 
222 218
 #if ENABLED(PROBE_OFFSET_WIZARD)

+ 1
- 1
Marlin/src/lcd/menu/menu_delta_calibrate.cpp Просмотреть файл

@@ -86,7 +86,7 @@ void _man_probe_pt(const xy_pos_t &xy) {
86 86
     ui.goto_screen(_lcd_calibrate_homing);
87 87
   }
88 88
 
89
-  void _goto_tower_a(const float &a) {
89
+  void _goto_tower_a(const_float_t a) {
90 90
     xy_pos_t tower_vec = { cos(RADIANS(a)), sin(RADIANS(a)) };
91 91
     _man_probe_pt(tower_vec * delta_calibration_radius());
92 92
   }

+ 5
- 5
Marlin/src/lcd/menu/menu_item.h Просмотреть файл

@@ -77,8 +77,8 @@ template<typename NAME>
77 77
 class TMenuEditItem : MenuEditItemBase {
78 78
   private:
79 79
     typedef typename NAME::type_t type_t;
80
-    static inline float scale(const float value)      { return NAME::scale(value);            }
81
-    static inline float unscale(const float value)    { return NAME::unscale(value);          }
80
+    static inline float scale(const_float_t value)    { return NAME::scale(value);            }
81
+    static inline float unscale(const_float_t value)  { return NAME::unscale(value);          }
82 82
     static const char* to_string(const int32_t value) { return NAME::strfunc(unscale(value)); }
83 83
     static void load(void *ptr, const int32_t value)  { *((type_t*)ptr) = unscale(value);     }
84 84
   public:
@@ -114,9 +114,9 @@ class TMenuEditItem : MenuEditItemBase {
114 114
 #define DEFINE_MENU_EDIT_ITEM_TYPE(NAME, TYPE, STRFUNC, SCALE, V...) \
115 115
   struct MenuEditItemInfo_##NAME { \
116 116
     typedef TYPE type_t; \
117
-    static inline float scale(const float value)   { return value * (SCALE) + (V+0); } \
118
-    static inline float unscale(const float value) { return value / (SCALE) + (V+0); } \
119
-    static inline const char* strfunc(const float value) { return STRFUNC(_DOFIX(TYPE,value)); } \
117
+    static inline float scale(const_float_t value)   { return value * (SCALE) + (V+0); } \
118
+    static inline float unscale(const_float_t value) { return value / (SCALE) + (V+0); } \
119
+    static inline const char* strfunc(const_float_t value) { return STRFUNC(_DOFIX(TYPE,value)); } \
120 120
   }; \
121 121
   typedef TMenuEditItem<MenuEditItemInfo_##NAME> MenuItem_##NAME
122 122
 

+ 1
- 1
Marlin/src/lcd/menu/menu_motion.cpp Просмотреть файл

@@ -149,7 +149,7 @@ void lcd_move_z() { _lcd_move_xyz(GET_TEXT(MSG_MOVE_Z), Z_AXIS); }
149 149
 
150 150
 screenFunc_t _manual_move_func_ptr;
151 151
 
152
-void _goto_manual_move(const float scale) {
152
+void _goto_manual_move(const_float_t scale) {
153 153
   ui.defer_status_screen();
154 154
   ui.manual_move.menu_scale = scale;
155 155
   ui.goto_screen(_manual_move_func_ptr);

+ 2
- 2
Marlin/src/lcd/menu/menu_probe_offset.cpp Просмотреть файл

@@ -58,14 +58,14 @@ inline void z_clearance_move() {
58 58
   );
59 59
 }
60 60
 
61
-void set_offset_and_go_back(const float &z) {
61
+void set_offset_and_go_back(const_float_t z) {
62 62
   probe.offset.z = z;
63 63
   SET_SOFT_ENDSTOP_LOOSE(false);
64 64
   TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
65 65
   ui.goto_previous_screen_no_defer();
66 66
 }
67 67
 
68
-void _goto_manual_move_z(const float scale) {
68
+void _goto_manual_move_z(const_float_t scale) {
69 69
   ui.manual_move.menu_scale = scale;
70 70
   ui.goto_screen(lcd_move_z);
71 71
 }

+ 1
- 1
Marlin/src/lcd/menu/menu_ubl.cpp Просмотреть файл

@@ -92,7 +92,7 @@ void _lcd_mesh_fine_tune(PGM_P const msg) {
92 92
 // Init mesh editing and go to the fine tuning screen (ubl.fine_tune_mesh)
93 93
 // To capture encoder events UBL will also call ui.capture and ui.release.
94 94
 //
95
-void MarlinUI::ubl_mesh_edit_start(const float &initial) {
95
+void MarlinUI::ubl_mesh_edit_start(const_float_t initial) {
96 96
   TERN_(HAS_GRAPHICAL_TFT, clear_lcd());
97 97
   mesh_edit_accumulator = initial;
98 98
   goto_screen([]{ _lcd_mesh_fine_tune(GET_TEXT(MSG_MESH_EDIT_Z)); });

+ 2
- 2
Marlin/src/libs/L64XX/L64XX_Marlin.cpp Просмотреть файл

@@ -368,12 +368,12 @@ void L64XX_Marlin::set_param(const L64XX_axis_t axis, const uint8_t param, const
368 368
   }
369 369
 }
370 370
 
371
-inline void echo_min_max(const char a, const float &min, const float &max) {
371
+inline void echo_min_max(const char a, const_float_t min, const_float_t max) {
372 372
   DEBUG_CHAR(' '); DEBUG_CHAR(a);
373 373
   DEBUG_ECHOPAIR(" min = ", min);
374 374
   DEBUG_ECHOLNPAIR("  max = ", max);
375 375
 }
376
-inline void echo_oct_used(const float &oct, const uint8_t stall) {
376
+inline void echo_oct_used(const_float_t oct, const uint8_t stall) {
377 377
   DEBUG_ECHOPAIR("over_current_threshold used     : ", oct);
378 378
   DEBUG_ECHOPGM_P(stall ? PSTR("  (Stall") : PSTR("  (OCD"));
379 379
   DEBUG_ECHOLNPGM(" threshold)");

+ 4
- 4
Marlin/src/libs/least_squares_fit.h Просмотреть файл

@@ -47,7 +47,7 @@ inline void incremental_LSF_reset(struct linear_fit_data *lsf) {
47 47
   memset(lsf, 0, sizeof(linear_fit_data));
48 48
 }
49 49
 
50
-inline void incremental_WLSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z, const float &w) {
50
+inline void incremental_WLSF(struct linear_fit_data *lsf, const_float_t x, const_float_t y, const_float_t z, const_float_t w) {
51 51
   // weight each accumulator by factor w, including the "number" of samples
52 52
   // (analogous to calling inc_LSF twice with same values to weight it by 2X)
53 53
   const float wx = w * x, wy = w * y, wz = w * z;
@@ -63,11 +63,11 @@ inline void incremental_WLSF(struct linear_fit_data *lsf, const float &x, const
63 63
   lsf->max_absx = _MAX(ABS(wx), lsf->max_absx);
64 64
   lsf->max_absy = _MAX(ABS(wy), lsf->max_absy);
65 65
 }
66
-inline void incremental_WLSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z, const float &w) {
66
+inline void incremental_WLSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const_float_t z, const_float_t w) {
67 67
   incremental_WLSF(lsf, pos.x, pos.y, z, w);
68 68
 }
69 69
 
70
-inline void incremental_LSF(struct linear_fit_data *lsf, const float &x, const float &y, const float &z) {
70
+inline void incremental_LSF(struct linear_fit_data *lsf, const_float_t x, const_float_t y, const_float_t z) {
71 71
   lsf->xbar += x;
72 72
   lsf->ybar += y;
73 73
   lsf->zbar += z;
@@ -80,7 +80,7 @@ inline void incremental_LSF(struct linear_fit_data *lsf, const float &x, const f
80 80
   lsf->max_absy = _MAX(ABS(y), lsf->max_absy);
81 81
   lsf->N += 1.0;
82 82
 }
83
-inline void incremental_LSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const float &z) {
83
+inline void incremental_LSF(struct linear_fit_data *lsf, const xy_pos_t &pos, const_float_t z) {
84 84
   incremental_LSF(lsf, pos.x, pos.y, z);
85 85
 }
86 86
 

+ 2
- 2
Marlin/src/libs/nozzle.cpp Просмотреть файл

@@ -130,7 +130,7 @@ Nozzle nozzle;
130 130
    * @param strokes number of strokes to execute
131 131
    * @param radius radius of circle
132 132
    */
133
-  void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) {
133
+  void Nozzle::circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) {
134 134
     if (strokes == 0) return;
135 135
 
136 136
     #if ENABLED(NOZZLE_CLEAN_GOBACK)
@@ -158,7 +158,7 @@ Nozzle nozzle;
158 158
    * @param pattern one of the available patterns
159 159
    * @param argument depends on the cleaning pattern
160 160
    */
161
-  void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) {
161
+  void Nozzle::clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) {
162 162
     xyz_pos_t start[HOTENDS] = NOZZLE_CLEAN_START_POINT, end[HOTENDS] = NOZZLE_CLEAN_END_POINT, middle[HOTENDS] = NOZZLE_CLEAN_CIRCLE_MIDDLE;
163 163
 
164 164
     const uint8_t arrPos = ANY(SINGLENOZZLE, MIXING_EXTRUDER) ? 0 : active_extruder;

+ 2
- 2
Marlin/src/libs/nozzle.h Просмотреть файл

@@ -62,7 +62,7 @@ class Nozzle {
62 62
      * @param strokes number of strokes to execute
63 63
      * @param radius radius of circle
64 64
      */
65
-    static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const float &radius) _Os;
65
+    static void circle(const xyz_pos_t &start, const xyz_pos_t &middle, const uint8_t &strokes, const_float_t radius) _Os;
66 66
 
67 67
   #endif // NOZZLE_CLEAN_FEATURE
68 68
 
@@ -77,7 +77,7 @@ class Nozzle {
77 77
      * @param pattern one of the available patterns
78 78
      * @param argument depends on the cleaning pattern
79 79
      */
80
-    static void clean(const uint8_t &pattern, const uint8_t &strokes, const float &radius, const uint8_t &objects, const uint8_t cleans) _Os;
80
+    static void clean(const uint8_t &pattern, const uint8_t &strokes, const_float_t radius, const uint8_t &objects, const uint8_t cleans) _Os;
81 81
 
82 82
   #endif // NOZZLE_CLEAN_FEATURE
83 83
 

+ 19
- 19
Marlin/src/libs/numtostr.cpp Просмотреть файл

@@ -178,7 +178,7 @@ const char* i16tostr4signrj(const int16_t i) {
178 178
 }
179 179
 
180 180
 // Convert unsigned float to string with 1.1 format
181
-const char* ftostr11ns(const float &f) {
181
+const char* ftostr11ns(const_float_t f) {
182 182
   const long i = UINTFLOAT(f, 1);
183 183
   conv[4] = DIGIMOD(i, 10);
184 184
   conv[5] = '.';
@@ -187,7 +187,7 @@ const char* ftostr11ns(const float &f) {
187 187
 }
188 188
 
189 189
 // Convert unsigned float to string with 1.23 format
190
-const char* ftostr12ns(const float &f) {
190
+const char* ftostr12ns(const_float_t f) {
191 191
   const long i = UINTFLOAT(f, 2);
192 192
   conv[3] = DIGIMOD(i, 100);
193 193
   conv[4] = '.';
@@ -197,7 +197,7 @@ const char* ftostr12ns(const float &f) {
197 197
 }
198 198
 
199 199
 // Convert unsigned float to string with 12.3 format
200
-const char* ftostr31ns(const float &f) {
200
+const char* ftostr31ns(const_float_t f) {
201 201
   const long i = UINTFLOAT(f, 1);
202 202
   conv[3] = DIGIMOD(i, 100);
203 203
   conv[4] = DIGIMOD(i, 10);
@@ -207,7 +207,7 @@ const char* ftostr31ns(const float &f) {
207 207
 }
208 208
 
209 209
 // Convert unsigned float to string with 123.4 format
210
-const char* ftostr41ns(const float &f) {
210
+const char* ftostr41ns(const_float_t f) {
211 211
   const long i = UINTFLOAT(f, 1);
212 212
   conv[2] = DIGIMOD(i, 1000);
213 213
   conv[3] = DIGIMOD(i, 100);
@@ -218,7 +218,7 @@ const char* ftostr41ns(const float &f) {
218 218
 }
219 219
 
220 220
 // Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format
221
-const char* ftostr42_52(const float &f) {
221
+const char* ftostr42_52(const_float_t f) {
222 222
   if (f <= -10 || f >= 100) return ftostr52(f); // -23.45 / 123.45
223 223
   long i = INTFLOAT(f, 2);
224 224
   conv[2] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 1000));
@@ -230,7 +230,7 @@ const char* ftostr42_52(const float &f) {
230 230
 }
231 231
 
232 232
 // Convert signed float to fixed-length string with 023.45 / -23.45 format
233
-const char* ftostr52(const float &f) {
233
+const char* ftostr52(const_float_t f) {
234 234
   long i = INTFLOAT(f, 2);
235 235
   conv[1] = MINUSOR(i, DIGIMOD(i, 10000));
236 236
   conv[2] = DIGIMOD(i, 1000);
@@ -242,7 +242,7 @@ const char* ftostr52(const float &f) {
242 242
 }
243 243
 
244 244
 // Convert signed float to fixed-length string with 12.345 / _2.345 / -2.345 or -23.45 / 123.45 format
245
-const char* ftostr53_63(const float &f) {
245
+const char* ftostr53_63(const_float_t f) {
246 246
   if (f <= -10 || f >= 100) return ftostr63(f); // -23.456 / 123.456
247 247
   long i = INTFLOAT(f, 3);
248 248
   conv[1] = (f >= 0 && f < 10) ? ' ' : MINUSOR(i, DIGIMOD(i, 10000));
@@ -255,7 +255,7 @@ const char* ftostr53_63(const float &f) {
255 255
 }
256 256
 
257 257
 // Convert signed float to fixed-length string with 023.456 / -23.456 format
258
-const char* ftostr63(const float &f) {
258
+const char* ftostr63(const_float_t f) {
259 259
   long i = INTFLOAT(f, 3);
260 260
   conv[0] = MINUSOR(i, DIGIMOD(i, 100000));
261 261
   conv[1] = DIGIMOD(i, 10000);
@@ -270,7 +270,7 @@ const char* ftostr63(const float &f) {
270 270
 #if ENABLED(LCD_DECIMAL_SMALL_XY)
271 271
 
272 272
   // Convert float to rj string with 1234, _123, -123, _-12, 12.3, _1.2, or -1.2 format
273
-  const char* ftostr4sign(const float &f) {
273
+  const char* ftostr4sign(const_float_t f) {
274 274
     const int i = INTFLOAT(f, 1);
275 275
     if (!WITHIN(i, -99, 999)) return i16tostr4signrj((int)f);
276 276
     const bool neg = i < 0;
@@ -285,7 +285,7 @@ const char* ftostr63(const float &f) {
285 285
 #endif
286 286
 
287 287
 // Convert float to fixed-length string with +12.3 / -12.3 format
288
-const char* ftostr31sign(const float &f) {
288
+const char* ftostr31sign(const_float_t f) {
289 289
   int i = INTFLOAT(f, 1);
290 290
   conv[2] = MINUSOR(i, '+');
291 291
   conv[3] = DIGIMOD(i, 100);
@@ -296,7 +296,7 @@ const char* ftostr31sign(const float &f) {
296 296
 }
297 297
 
298 298
 // Convert float to fixed-length string with +123.4 / -123.4 format
299
-const char* ftostr41sign(const float &f) {
299
+const char* ftostr41sign(const_float_t f) {
300 300
   int i = INTFLOAT(f, 1);
301 301
   conv[1] = MINUSOR(i, '+');
302 302
   conv[2] = DIGIMOD(i, 1000);
@@ -308,7 +308,7 @@ const char* ftostr41sign(const float &f) {
308 308
 }
309 309
 
310 310
 // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
311
-const char* ftostr43sign(const float &f, char plus/*=' '*/) {
311
+const char* ftostr43sign(const_float_t f, char plus/*=' '*/) {
312 312
   long i = INTFLOAT(f, 3);
313 313
   conv[1] = i ? MINUSOR(i, plus) : ' ';
314 314
   conv[2] = DIGIMOD(i, 1000);
@@ -320,7 +320,7 @@ const char* ftostr43sign(const float &f, char plus/*=' '*/) {
320 320
 }
321 321
 
322 322
 // Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format
323
-const char* ftostr54sign(const float &f, char plus/*=' '*/) {
323
+const char* ftostr54sign(const_float_t f, char plus/*=' '*/) {
324 324
   long i = INTFLOAT(f, 4);
325 325
   conv[0] = i ? MINUSOR(i, plus) : ' ';
326 326
   conv[1] = DIGIMOD(i, 10000);
@@ -333,13 +333,13 @@ const char* ftostr54sign(const float &f, char plus/*=' '*/) {
333 333
 }
334 334
 
335 335
 // Convert unsigned float to rj string with 12345 format
336
-const char* ftostr5rj(const float &f) {
336
+const char* ftostr5rj(const_float_t f) {
337 337
   const long i = UINTFLOAT(f, 0);
338 338
   return ui16tostr5rj(i);
339 339
 }
340 340
 
341 341
 // Convert signed float to string with +1234.5 format
342
-const char* ftostr51sign(const float &f) {
342
+const char* ftostr51sign(const_float_t f) {
343 343
   long i = INTFLOAT(f, 1);
344 344
   conv[0] = MINUSOR(i, '+');
345 345
   conv[1] = DIGIMOD(i, 10000);
@@ -352,7 +352,7 @@ const char* ftostr51sign(const float &f) {
352 352
 }
353 353
 
354 354
 // Convert signed float to string with +123.45 format
355
-const char* ftostr52sign(const float &f) {
355
+const char* ftostr52sign(const_float_t f) {
356 356
   long i = INTFLOAT(f, 2);
357 357
   conv[0] = MINUSOR(i, '+');
358 358
   conv[1] = DIGIMOD(i, 10000);
@@ -365,7 +365,7 @@ const char* ftostr52sign(const float &f) {
365 365
 }
366 366
 
367 367
 // Convert signed float to string with +12.345 format
368
-const char* ftostr53sign(const float &f) {
368
+const char* ftostr53sign(const_float_t f) {
369 369
   long i = INTFLOAT(f, 3);
370 370
   conv[0] = MINUSOR(i, '+');
371 371
   conv[1] = DIGIMOD(i, 10000);
@@ -378,7 +378,7 @@ const char* ftostr53sign(const float &f) {
378 378
 }
379 379
 
380 380
 // Convert unsigned float to string with ____4.5, __34.5, _234.5, 1234.5 format
381
-const char* ftostr51rj(const float &f) {
381
+const char* ftostr51rj(const_float_t f) {
382 382
   const long i = UINTFLOAT(f, 1);
383 383
   conv[0] = ' ';
384 384
   conv[1] = RJDIGIT(i, 10000);
@@ -391,7 +391,7 @@ const char* ftostr51rj(const float &f) {
391 391
 }
392 392
 
393 393
 // Convert signed float to space-padded string with -_23.4_ format
394
-const char* ftostr52sp(const float &f) {
394
+const char* ftostr52sp(const_float_t f) {
395 395
   long i = INTFLOAT(f, 2);
396 396
   uint8_t dig;
397 397
   conv[0] = MINUSOR(i, ' ');

+ 23
- 26
Marlin/src/libs/numtostr.h Просмотреть файл

@@ -21,7 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
-#include <stdint.h>
24
+#include "../inc/MarlinConfigPre.h"
25
+#include "../core/types.h"
25 26
 
26 27
 // Format uint8_t (0-100) as rj string with 123% / _12% / __1% format
27 28
 const char* pcttostrpctrj(const uint8_t i);
@@ -62,70 +63,66 @@ const char* i16tostr3left(const int16_t xx);
62 63
 const char* i16tostr4signrj(const int16_t x);
63 64
 
64 65
 // Convert unsigned float to string with 1.2 format
65
-const char* ftostr11ns(const float &x);
66
+const char* ftostr11ns(const_float_t x);
66 67
 
67 68
 // Convert unsigned float to string with 1.23 format
68
-const char* ftostr12ns(const float &x);
69
+const char* ftostr12ns(const_float_t x);
69 70
 
70 71
 // Convert unsigned float to string with 12.3 format
71
-const char* ftostr31ns(const float &x);
72
+const char* ftostr31ns(const_float_t x);
72 73
 
73 74
 // Convert unsigned float to string with 123.4 format
74
-const char* ftostr41ns(const float &x);
75
+const char* ftostr41ns(const_float_t x);
75 76
 
76 77
 // Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format
77
-const char* ftostr42_52(const float &x);
78
+const char* ftostr42_52(const_float_t x);
78 79
 
79 80
 // Convert signed float to fixed-length string with 023.45 / -23.45 format
80
-const char* ftostr52(const float &x);
81
+const char* ftostr52(const_float_t x);
81 82
 
82 83
 // Convert signed float to fixed-length string with 12.345 / -2.345 or 023.456 / -23.456 format
83
-const char* ftostr53_63(const float &x);
84
+const char* ftostr53_63(const_float_t x);
84 85
 
85 86
 // Convert signed float to fixed-length string with 023.456 / -23.456 format
86
-const char* ftostr63(const float &x);
87
+const char* ftostr63(const_float_t x);
87 88
 
88 89
 // Convert float to fixed-length string with +12.3 / -12.3 format
89
-const char* ftostr31sign(const float &x);
90
+const char* ftostr31sign(const_float_t x);
90 91
 
91 92
 // Convert float to fixed-length string with +123.4 / -123.4 format
92
-const char* ftostr41sign(const float &x);
93
+const char* ftostr41sign(const_float_t x);
93 94
 
94 95
 // Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
95
-const char* ftostr43sign(const float &x, char plus=' ');
96
+const char* ftostr43sign(const_float_t x, char plus=' ');
96 97
 
97 98
 // Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format
98
-const char* ftostr54sign(const float &x, char plus=' ');
99
+const char* ftostr54sign(const_float_t x, char plus=' ');
99 100
 
100 101
 // Convert unsigned float to rj string with 12345 format
101
-const char* ftostr5rj(const float &x);
102
+const char* ftostr5rj(const_float_t x);
102 103
 
103 104
 // Convert signed float to string with +1234.5 format
104
-const char* ftostr51sign(const float &x);
105
+const char* ftostr51sign(const_float_t x);
105 106
 
106 107
 // Convert signed float to space-padded string with -_23.4_ format
107
-const char* ftostr52sp(const float &x);
108
+const char* ftostr52sp(const_float_t x);
108 109
 
109 110
 // Convert signed float to string with +123.45 format
110
-const char* ftostr52sign(const float &x);
111
+const char* ftostr52sign(const_float_t x);
111 112
 
112 113
 // Convert signed float to string with +12.345 format
113
-const char* ftostr53sign(const float &f);
114
+const char* ftostr53sign(const_float_t f);
114 115
 
115 116
 // Convert unsigned float to string with 1234.5 format omitting trailing zeros
116
-const char* ftostr51rj(const float &x);
117
-
118
-#include "../core/macros.h"
117
+const char* ftostr51rj(const_float_t x);
119 118
 
120 119
 // Convert float to rj string with 123 or -12 format
121
-FORCE_INLINE const char* ftostr3(const float &x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
122
-
123
-#include "../inc/MarlinConfigPre.h"
120
+FORCE_INLINE const char* ftostr3(const_float_t x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
124 121
 
125 122
 #if ENABLED(LCD_DECIMAL_SMALL_XY)
126 123
   // Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
127
-  const char* ftostr4sign(const float &fx);
124
+  const char* ftostr4sign(const_float_t fx);
128 125
 #else
129 126
   // Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
130
-  FORCE_INLINE const char* ftostr4sign(const float &x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
127
+  FORCE_INLINE const char* ftostr4sign(const_float_t x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
131 128
 #endif

+ 1
- 1
Marlin/src/libs/vector_3.h Просмотреть файл

@@ -45,7 +45,7 @@
45 45
 class matrix_3x3;
46 46
 
47 47
 struct vector_3 : xyz_float_t {
48
-  vector_3(const float &_x, const float &_y, const float &_z) { set(_x, _y, _z); }
48
+  vector_3(const_float_t _x, const_float_t _y, const_float_t _z) { set(_x, _y, _z); }
49 49
   vector_3(const xy_float_t   &in) { set(in.x, in.y); }
50 50
   vector_3(const xyz_float_t  &in) { set(in.x, in.y, in.z); }
51 51
   vector_3(const xyze_float_t &in) { set(in.x, in.y, in.z); }

+ 1
- 1
Marlin/src/module/delta.cpp Просмотреть файл

@@ -177,7 +177,7 @@ float delta_safe_distance_from_top() {
177 177
  *
178 178
  * The result is stored in the cartes[] array.
179 179
  */
180
-void forward_kinematics(const float &z1, const float &z2, const float &z3) {
180
+void forward_kinematics(const_float_t z1, const_float_t z2, const_float_t z3) {
181 181
   // Create a vector in old coordinates along x axis of new coordinate
182 182
   const float p12[3] = { delta_tower[B_AXIS].x - delta_tower[A_AXIS].x, delta_tower[B_AXIS].y - delta_tower[A_AXIS].y, z2 - z1 },
183 183
 

+ 1
- 1
Marlin/src/module/delta.h Просмотреть файл

@@ -120,7 +120,7 @@ float delta_safe_distance_from_top();
120 120
  *
121 121
  * The result is stored in the cartes[] array.
122 122
  */
123
-void forward_kinematics(const float &z1, const float &z2, const float &z3);
123
+void forward_kinematics(const_float_t z1, const_float_t z2, const_float_t z3);
124 124
 
125 125
 FORCE_INLINE void forward_kinematics(const abc_float_t &point) {
126 126
   forward_kinematics(point.a, point.b, point.c);

+ 16
- 16
Marlin/src/module/motion.cpp Просмотреть файл

@@ -311,12 +311,12 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) {
311 311
  * Move the planner to the current position from wherever it last moved
312 312
  * (or from wherever it has been told it is located).
313 313
  */
314
-void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
314
+void line_to_current_position(const_feedRate_t fr_mm_s/*=feedrate_mm_s*/) {
315 315
   planner.buffer_line(current_position, fr_mm_s, active_extruder);
316 316
 }
317 317
 
318 318
 #if EXTRUDERS
319
-  void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s) {
319
+  void unscaled_e_move(const_float_t length, const_feedRate_t fr_mm_s) {
320 320
     TERN_(HAS_FILAMENT_SENSOR, runout.reset());
321 321
     current_position.e += length / planner.e_factor[active_extruder];
322 322
     line_to_current_position(fr_mm_s);
@@ -329,7 +329,7 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
329 329
   /**
330 330
    * Buffer a fast move without interpolation. Set current_position to destination
331 331
    */
332
-  void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s/*=MMS_SCALED(feedrate_mm_s)*/) {
332
+  void prepare_fast_move_to_destination(const_feedRate_t scaled_fr_mm_s/*=MMS_SCALED(feedrate_mm_s)*/) {
333 333
     if (DEBUGGING(LEVELING)) DEBUG_POS("prepare_fast_move_to_destination", destination);
334 334
 
335 335
     #if UBL_SEGMENTED
@@ -351,7 +351,7 @@ void line_to_current_position(const feedRate_t &fr_mm_s/*=feedrate_mm_s*/) {
351 351
  *  - Move at normal speed regardless of feedrate percentage.
352 352
  *  - Extrude the specified length regardless of flow percentage.
353 353
  */
354
-void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/
354
+void _internal_move_to_destination(const_feedRate_t fr_mm_s/*=0.0f*/
355 355
   #if IS_KINEMATIC
356 356
     , const bool is_fast/*=false*/
357 357
   #endif
@@ -384,7 +384,7 @@ void _internal_move_to_destination(const feedRate_t &fr_mm_s/*=0.0f*/
384 384
 /**
385 385
  * Plan a move to (X, Y, Z) and set the current_position
386 386
  */
387
-void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s/*=0.0*/) {
387
+void do_blocking_move_to(const float rx, const float ry, const float rz, const_feedRate_t fr_mm_s/*=0.0*/) {
388 388
   DEBUG_SECTION(log_move, "do_blocking_move_to", DEBUGGING(LEVELING));
389 389
   if (DEBUGGING(LEVELING)) DEBUG_XYZ("> ", rx, ry, rz);
390 390
 
@@ -473,38 +473,38 @@ void do_blocking_move_to(const float rx, const float ry, const float rz, const f
473 473
   planner.synchronize();
474 474
 }
475 475
 
476
-void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
476
+void do_blocking_move_to(const xy_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*/) {
477 477
   do_blocking_move_to(raw.x, raw.y, current_position.z, fr_mm_s);
478 478
 }
479
-void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
479
+void do_blocking_move_to(const xyz_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*/) {
480 480
   do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
481 481
 }
482
-void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
482
+void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*/) {
483 483
   do_blocking_move_to(raw.x, raw.y, raw.z, fr_mm_s);
484 484
 }
485 485
 
486
-void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s/*=0.0*/) {
486
+void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s/*=0.0*/) {
487 487
   do_blocking_move_to(rx, current_position.y, current_position.z, fr_mm_s);
488 488
 }
489
-void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) {
489
+void do_blocking_move_to_y(const_float_t ry, const_feedRate_t fr_mm_s/*=0.0*/) {
490 490
   do_blocking_move_to(current_position.x, ry, current_position.z, fr_mm_s);
491 491
 }
492
-void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s/*=0.0*/) {
492
+void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s/*=0.0*/) {
493 493
   do_blocking_move_to_xy_z(current_position, rz, fr_mm_s);
494 494
 }
495 495
 
496
-void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s/*=0.0*/) {
496
+void do_blocking_move_to_xy(const_float_t rx, const_float_t ry, const_feedRate_t fr_mm_s/*=0.0*/) {
497 497
   do_blocking_move_to(rx, ry, current_position.z, fr_mm_s);
498 498
 }
499
-void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s/*=0.0f*/) {
499
+void do_blocking_move_to_xy(const xy_pos_t &raw, const_feedRate_t fr_mm_s/*=0.0f*/) {
500 500
   do_blocking_move_to_xy(raw.x, raw.y, fr_mm_s);
501 501
 }
502 502
 
503
-void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s/*=0.0f*/) {
503
+void do_blocking_move_to_xy_z(const xy_pos_t &raw, const_float_t z, const_feedRate_t fr_mm_s/*=0.0f*/) {
504 504
   do_blocking_move_to(raw.x, raw.y, z, fr_mm_s);
505 505
 }
506 506
 
507
-void do_z_clearance(const float &zclear, const bool lower_allowed/*=false*/) {
507
+void do_z_clearance(const_float_t zclear, const bool lower_allowed/*=false*/) {
508 508
   float zdest = zclear;
509 509
   if (!lower_allowed) NOLESS(zdest, current_position.z);
510 510
   do_blocking_move_to_z(_MIN(zdest, Z_MAX_POS), TERN(HAS_BED_PROBE, z_probe_fast_mm_s, homing_feedrate(Z_AXIS)));
@@ -826,7 +826,7 @@ FORCE_INLINE void segment_idle(millis_t &next_idle_ms) {
826 826
      * small incremental moves. This allows the planner to
827 827
      * apply more detailed bed leveling to the full move.
828 828
      */
829
-    inline void segmented_line_to_destination(const feedRate_t &fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) {
829
+    inline void segmented_line_to_destination(const_feedRate_t fr_mm_s, const float segment_size=LEVELED_SEGMENT_LENGTH) {
830 830
 
831 831
       const xyze_float_t diff = destination - current_position;
832 832
 

+ 23
- 23
Marlin/src/module/motion.h Просмотреть файл

@@ -229,28 +229,28 @@ void sync_plan_position_e();
229 229
  * Move the planner to the current position from wherever it last moved
230 230
  * (or from wherever it has been told it is located).
231 231
  */
232
-void line_to_current_position(const feedRate_t &fr_mm_s=feedrate_mm_s);
232
+void line_to_current_position(const_feedRate_t fr_mm_s=feedrate_mm_s);
233 233
 
234 234
 #if EXTRUDERS
235
-  void unscaled_e_move(const float &length, const feedRate_t &fr_mm_s);
235
+  void unscaled_e_move(const_float_t length, const_feedRate_t fr_mm_s);
236 236
 #endif
237 237
 
238 238
 void prepare_line_to_destination();
239 239
 
240
-void _internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f
240
+void _internal_move_to_destination(const_feedRate_t fr_mm_s=0.0f
241 241
   #if IS_KINEMATIC
242 242
     , const bool is_fast=false
243 243
   #endif
244 244
 );
245 245
 
246
-inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f) {
246
+inline void prepare_internal_move_to_destination(const_feedRate_t fr_mm_s=0.0f) {
247 247
   _internal_move_to_destination(fr_mm_s);
248 248
 }
249 249
 
250 250
 #if IS_KINEMATIC
251
-  void prepare_fast_move_to_destination(const feedRate_t &scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s));
251
+  void prepare_fast_move_to_destination(const_feedRate_t scaled_fr_mm_s=MMS_SCALED(feedrate_mm_s));
252 252
 
253
-  inline void prepare_internal_fast_move_to_destination(const feedRate_t &fr_mm_s=0.0f) {
253
+  inline void prepare_internal_fast_move_to_destination(const_feedRate_t fr_mm_s=0.0f) {
254 254
     _internal_move_to_destination(fr_mm_s, true);
255 255
   }
256 256
 #endif
@@ -258,29 +258,29 @@ inline void prepare_internal_move_to_destination(const feedRate_t &fr_mm_s=0.0f)
258 258
 /**
259 259
  * Blocking movement and shorthand functions
260 260
  */
261
-void do_blocking_move_to(const float rx, const float ry, const float rz, const feedRate_t &fr_mm_s=0.0f);
262
-void do_blocking_move_to(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
263
-void do_blocking_move_to(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
264
-void do_blocking_move_to(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
261
+void do_blocking_move_to(const float rx, const float ry, const float rz, const_feedRate_t fr_mm_s=0.0f);
262
+void do_blocking_move_to(const xy_pos_t &raw, const_feedRate_t fr_mm_s=0.0f);
263
+void do_blocking_move_to(const xyz_pos_t &raw, const_feedRate_t fr_mm_s=0.0f);
264
+void do_blocking_move_to(const xyze_pos_t &raw, const_feedRate_t fr_mm_s=0.0f);
265 265
 
266
-void do_blocking_move_to_x(const float &rx, const feedRate_t &fr_mm_s=0.0f);
267
-void do_blocking_move_to_y(const float &ry, const feedRate_t &fr_mm_s=0.0f);
268
-void do_blocking_move_to_z(const float &rz, const feedRate_t &fr_mm_s=0.0f);
266
+void do_blocking_move_to_x(const_float_t rx, const_feedRate_t fr_mm_s=0.0f);
267
+void do_blocking_move_to_y(const_float_t ry, const_feedRate_t fr_mm_s=0.0f);
268
+void do_blocking_move_to_z(const_float_t rz, const_feedRate_t fr_mm_s=0.0f);
269 269
 
270
-void do_blocking_move_to_xy(const float &rx, const float &ry, const feedRate_t &fr_mm_s=0.0f);
271
-void do_blocking_move_to_xy(const xy_pos_t &raw, const feedRate_t &fr_mm_s=0.0f);
272
-FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const feedRate_t &fr_mm_s=0.0f)  { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
273
-FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
270
+void do_blocking_move_to_xy(const_float_t rx, const_float_t ry, const_feedRate_t fr_mm_s=0.0f);
271
+void do_blocking_move_to_xy(const xy_pos_t &raw, const_feedRate_t fr_mm_s=0.0f);
272
+FORCE_INLINE void do_blocking_move_to_xy(const xyz_pos_t &raw, const_feedRate_t fr_mm_s=0.0f)  { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
273
+FORCE_INLINE void do_blocking_move_to_xy(const xyze_pos_t &raw, const_feedRate_t fr_mm_s=0.0f) { do_blocking_move_to_xy(xy_pos_t(raw), fr_mm_s); }
274 274
 
275
-void do_blocking_move_to_xy_z(const xy_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f);
276
-FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f)  { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
277
-FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const float &z, const feedRate_t &fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
275
+void do_blocking_move_to_xy_z(const xy_pos_t &raw, const_float_t z, const_feedRate_t fr_mm_s=0.0f);
276
+FORCE_INLINE void do_blocking_move_to_xy_z(const xyz_pos_t &raw, const_float_t z, const_feedRate_t fr_mm_s=0.0f)  { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
277
+FORCE_INLINE void do_blocking_move_to_xy_z(const xyze_pos_t &raw, const_float_t z, const_feedRate_t fr_mm_s=0.0f) { do_blocking_move_to_xy_z(xy_pos_t(raw), z, fr_mm_s); }
278 278
 
279 279
 void remember_feedrate_and_scaling();
280 280
 void remember_feedrate_scaling_off();
281 281
 void restore_feedrate_and_scaling();
282 282
 
283
-void do_z_clearance(const float &zclear, const bool lower_allowed=false);
283
+void do_z_clearance(const_float_t zclear, const bool lower_allowed=false);
284 284
 
285 285
 /**
286 286
  * Homing and Trusted Axes
@@ -393,7 +393,7 @@ FORCE_INLINE bool all_axes_trusted()                        { return xyz_bits ==
393 393
   #endif
394 394
 
395 395
   // Return true if the given point is within the printable area
396
-  inline bool position_is_reachable(const float &rx, const float &ry, const float inset=0) {
396
+  inline bool position_is_reachable(const_float_t rx, const_float_t ry, const float inset=0) {
397 397
     #if ENABLED(DELTA)
398 398
 
399 399
       return HYPOT2(rx, ry) <= sq(DELTA_PRINTABLE_RADIUS - inset + fslop);
@@ -428,7 +428,7 @@ FORCE_INLINE bool all_axes_trusted()                        { return xyz_bits ==
428 428
 #else // CARTESIAN
429 429
 
430 430
   // Return true if the given position is within the machine bounds.
431
-  inline bool position_is_reachable(const float &rx, const float &ry) {
431
+  inline bool position_is_reachable(const_float_t rx, const_float_t ry) {
432 432
     if (!COORDINATE_OKAY(ry, Y_MIN_POS - fslop, Y_MAX_POS + fslop)) return false;
433 433
     #if ENABLED(DUAL_X_CARRIAGE)
434 434
       if (active_extruder)

+ 11
- 11
Marlin/src/module/planner.cpp Просмотреть файл

@@ -775,7 +775,7 @@ block_t* Planner::get_current_block() {
775 775
  * is not and will not use the block while we modify it, so it is safe to
776 776
  * alter its values.
777 777
  */
778
-void Planner::calculate_trapezoid_for_block(block_t * const block, const float &entry_factor, const float &exit_factor) {
778
+void Planner::calculate_trapezoid_for_block(block_t * const block, const_float_t entry_factor, const_float_t exit_factor) {
779 779
 
780 780
   uint32_t initial_rate = CEIL(block->nominal_rate * entry_factor),
781 781
            final_rate = CEIL(block->nominal_rate * exit_factor); // (steps per second)
@@ -1463,7 +1463,7 @@ void Planner::check_axes_activity() {
1463 1463
    * This is the reciprocal of the circular cross-section area.
1464 1464
    * Return 1.0 with volumetric off or a diameter of 0.0.
1465 1465
    */
1466
-  inline float calculate_volumetric_multiplier(const float &diameter) {
1466
+  inline float calculate_volumetric_multiplier(const_float_t diameter) {
1467 1467
     return (parser.volumetric_enabled && diameter) ? 1.0f / CIRCLE_AREA(diameter * 0.5f) : 1;
1468 1468
   }
1469 1469
 
@@ -1745,7 +1745,7 @@ bool Planner::_buffer_steps(const xyze_long_t &target
1745 1745
   #if HAS_DIST_MM_ARG
1746 1746
     , const xyze_float_t &cart_dist_mm
1747 1747
   #endif
1748
-  , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
1748
+  , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters
1749 1749
 ) {
1750 1750
 
1751 1751
   // Wait for the next available block
@@ -1811,7 +1811,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1811 1811
   #if HAS_DIST_MM_ARG
1812 1812
     , const xyze_float_t &cart_dist_mm
1813 1813
   #endif
1814
-  , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
1814
+  , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters/*=0.0*/
1815 1815
 ) {
1816 1816
 
1817 1817
   const int32_t da = target.a - position.a,
@@ -2745,11 +2745,11 @@ void Planner::buffer_sync_block(TERN_(LASER_SYNCHRONOUS_M106_M107, uint8_t sync_
2745 2745
  *
2746 2746
  * Return 'false' if no segment was queued due to cleaning, cold extrusion, full queue, etc.
2747 2747
  */
2748
-bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e
2748
+bool Planner::buffer_segment(const_float_t a, const_float_t b, const_float_t c, const_float_t e
2749 2749
   #if HAS_DIST_MM_ARG
2750 2750
     , const xyze_float_t &cart_dist_mm
2751 2751
   #endif
2752
-  , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
2752
+  , const_feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters/*=0.0*/
2753 2753
 ) {
2754 2754
 
2755 2755
   // If we are cleaning, do not accept queuing of movements
@@ -2839,9 +2839,9 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
2839 2839
  *  millimeters  - the length of the movement, if known
2840 2840
  *  inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled)
2841 2841
  */
2842
-bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters
2842
+bool Planner::buffer_line(const_float_t rx, const_float_t ry, const_float_t rz, const_float_t e, const_feedRate_t fr_mm_s, const uint8_t extruder, const float millimeters
2843 2843
   #if ENABLED(SCARA_FEEDRATE_SCALING)
2844
-    , const float &inv_duration
2844
+    , const_float_t inv_duration
2845 2845
   #endif
2846 2846
 ) {
2847 2847
   xyze_pos_t machine = { rx, ry, rz, e };
@@ -2960,7 +2960,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
2960 2960
  * The provided ABC position is in machine units.
2961 2961
  */
2962 2962
 
2963
-void Planner::set_machine_position_mm(const float &a, const float &b, const float &c, const float &e) {
2963
+void Planner::set_machine_position_mm(const_float_t a, const_float_t b, const_float_t c, const_float_t e) {
2964 2964
   TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder);
2965 2965
   TERN_(HAS_POSITION_FLOAT, position_float.set(a, b, c, e));
2966 2966
   position.set(LROUND(a * settings.axis_steps_per_mm[A_AXIS]),
@@ -2976,7 +2976,7 @@ void Planner::set_machine_position_mm(const float &a, const float &b, const floa
2976 2976
     stepper.set_position(position);
2977 2977
 }
2978 2978
 
2979
-void Planner::set_position_mm(const float &rx, const float &ry, const float &rz, const float &e) {
2979
+void Planner::set_position_mm(const_float_t rx, const_float_t ry, const_float_t rz, const_float_t e) {
2980 2980
   xyze_pos_t machine = { rx, ry, rz, e };
2981 2981
   #if HAS_POSITION_MODIFIERS
2982 2982
     apply_modifiers(machine, true);
@@ -2993,7 +2993,7 @@ void Planner::set_position_mm(const float &rx, const float &ry, const float &rz,
2993 2993
 /**
2994 2994
  * Setters for planner position (also setting stepper position).
2995 2995
  */
2996
-void Planner::set_e_position_mm(const float &e) {
2996
+void Planner::set_e_position_mm(const_float_t e) {
2997 2997
   const uint8_t axis_index = E_AXIS_N(active_extruder);
2998 2998
   TERN_(DISTINCT_E_FACTORS, last_extruder = active_extruder);
2999 2999
 

+ 28
- 28
Marlin/src/module/planner.h Просмотреть файл

@@ -491,7 +491,7 @@ class Planner {
491 491
     #if HAS_CLASSIC_JERK
492 492
       static void set_max_jerk(const AxisEnum axis, float inMaxJerkMMS);
493 493
     #else
494
-      static inline void set_max_jerk(const AxisEnum, const float&) {}
494
+      static inline void set_max_jerk(const AxisEnum, const_float_t ) {}
495 495
     #endif
496 496
 
497 497
     #if EXTRUDERS
@@ -541,7 +541,7 @@ class Planner {
541 541
         static void calculate_volumetric_extruder_limits();
542 542
       #endif
543 543
 
544
-      FORCE_INLINE static void set_filament_size(const uint8_t e, const float &v) {
544
+      FORCE_INLINE static void set_filament_size(const uint8_t e, const_float_t v) {
545 545
         filament_size[e] = v;
546 546
         if (v > 0) volumetric_area_nominal = CIRCLE_AREA(v * 0.5); //TODO: should it be per extruder
547 547
         // make sure all extruders have some sane value for the filament size
@@ -552,7 +552,7 @@ class Planner {
552 552
     #endif
553 553
 
554 554
     #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
555
-      FORCE_INLINE static void set_volumetric_extruder_limit(const uint8_t e, const float &v) {
555
+      FORCE_INLINE static void set_volumetric_extruder_limit(const uint8_t e, const_float_t v) {
556 556
         volumetric_extruder_limit[e] = v;
557 557
         calculate_volumetric_extruder_limit(e);
558 558
       }
@@ -567,7 +567,7 @@ class Planner {
567 567
        *  Returns 1.0 if planner.z_fade_height is 0.0.
568 568
        *  Returns 0.0 if Z is past the specified 'Fade Height'.
569 569
        */
570
-      static inline float fade_scaling_factor_for_z(const float &rz) {
570
+      static inline float fade_scaling_factor_for_z(const_float_t rz) {
571 571
         static float z_fade_factor = 1;
572 572
         if (!z_fade_height) return 1;
573 573
         if (rz >= z_fade_height) return 0;
@@ -580,27 +580,27 @@ class Planner {
580 580
 
581 581
       FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; }
582 582
 
583
-      FORCE_INLINE static void set_z_fade_height(const float &zfh) {
583
+      FORCE_INLINE static void set_z_fade_height(const_float_t zfh) {
584 584
         z_fade_height = zfh > 0 ? zfh : 0;
585 585
         inverse_z_fade_height = RECIPROCAL(z_fade_height);
586 586
         force_fade_recalc();
587 587
       }
588 588
 
589
-      FORCE_INLINE static bool leveling_active_at_z(const float &rz) {
589
+      FORCE_INLINE static bool leveling_active_at_z(const_float_t rz) {
590 590
         return !z_fade_height || rz < z_fade_height;
591 591
       }
592 592
 
593 593
     #else
594 594
 
595
-      FORCE_INLINE static float fade_scaling_factor_for_z(const float&) { return 1; }
595
+      FORCE_INLINE static float fade_scaling_factor_for_z(const_float_t ) { return 1; }
596 596
 
597
-      FORCE_INLINE static bool leveling_active_at_z(const float&) { return true; }
597
+      FORCE_INLINE static bool leveling_active_at_z(const_float_t ) { return true; }
598 598
 
599 599
     #endif
600 600
 
601 601
     #if ENABLED(SKEW_CORRECTION)
602 602
 
603
-      FORCE_INLINE static void skew(float &cx, float &cy, const float &cz) {
603
+      FORCE_INLINE static void skew(float &cx, float &cy, const_float_t cz) {
604 604
         if (COORDINATE_OKAY(cx, X_MIN_POS + 1, X_MAX_POS) && COORDINATE_OKAY(cy, Y_MIN_POS + 1, Y_MAX_POS)) {
605 605
           const float sx = cx - cy * skew_factor.xy - cz * (skew_factor.xz - (skew_factor.xy * skew_factor.yz)),
606 606
                       sy = cy - cz * skew_factor.yz;
@@ -611,7 +611,7 @@ class Planner {
611 611
       }
612 612
       FORCE_INLINE static void skew(xyz_pos_t &raw) { skew(raw.x, raw.y, raw.z); }
613 613
 
614
-      FORCE_INLINE static void unskew(float &cx, float &cy, const float &cz) {
614
+      FORCE_INLINE static void unskew(float &cx, float &cy, const_float_t cz) {
615 615
         if (COORDINATE_OKAY(cx, X_MIN_POS, X_MAX_POS) && COORDINATE_OKAY(cy, Y_MIN_POS, Y_MAX_POS)) {
616 616
           const float sx = cx + cy * skew_factor.xy + cz * skew_factor.xz,
617 617
                       sy = cy + cz * skew_factor.yz;
@@ -713,7 +713,7 @@ class Planner {
713 713
       #if HAS_DIST_MM_ARG
714 714
         , const xyze_float_t &cart_dist_mm
715 715
       #endif
716
-      , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
716
+      , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0
717 717
     );
718 718
 
719 719
     /**
@@ -736,7 +736,7 @@ class Planner {
736 736
       #if HAS_DIST_MM_ARG
737 737
         , const xyze_float_t &cart_dist_mm
738 738
       #endif
739
-      , feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
739
+      , feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0
740 740
     );
741 741
 
742 742
     /**
@@ -767,18 +767,18 @@ class Planner {
767 767
      *  extruder    - target extruder
768 768
      *  millimeters - the length of the movement, if known
769 769
      */
770
-    static bool buffer_segment(const float &a, const float &b, const float &c, const float &e
770
+    static bool buffer_segment(const_float_t a, const_float_t b, const_float_t c, const_float_t e
771 771
       #if HAS_DIST_MM_ARG
772 772
         , const xyze_float_t &cart_dist_mm
773 773
       #endif
774
-      , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
774
+      , const_feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0
775 775
     );
776 776
 
777 777
     FORCE_INLINE static bool buffer_segment(abce_pos_t &abce
778 778
       #if HAS_DIST_MM_ARG
779 779
         , const xyze_float_t &cart_dist_mm
780 780
       #endif
781
-      , const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters=0.0
781
+      , const_feedRate_t fr_mm_s, const uint8_t extruder, const_float_t millimeters=0.0
782 782
     ) {
783 783
       return buffer_segment(abce.a, abce.b, abce.c, abce.e
784 784
         #if HAS_DIST_MM_ARG
@@ -800,15 +800,15 @@ class Planner {
800 800
      *  millimeters  - the length of the movement, if known
801 801
      *  inv_duration - the reciprocal if the duration of the movement, if known (kinematic only if feeedrate scaling is enabled)
802 802
      */
803
-    static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0
803
+    static bool buffer_line(const_float_t rx, const_float_t ry, const_float_t rz, const_float_t e, const_feedRate_t fr_mm_s, const uint8_t extruder, const float millimeters=0.0
804 804
       #if ENABLED(SCARA_FEEDRATE_SCALING)
805
-        , const float &inv_duration=0.0
805
+        , const_float_t inv_duration=0.0
806 806
       #endif
807 807
     );
808 808
 
809
-    FORCE_INLINE static bool buffer_line(const xyze_pos_t &cart, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0
809
+    FORCE_INLINE static bool buffer_line(const xyze_pos_t &cart, const_feedRate_t fr_mm_s, const uint8_t extruder, const float millimeters=0.0
810 810
       #if ENABLED(SCARA_FEEDRATE_SCALING)
811
-        , const float &inv_duration=0.0
811
+        , const_float_t inv_duration=0.0
812 812
       #endif
813 813
     ) {
814 814
       return buffer_line(cart.x, cart.y, cart.z, cart.e, fr_mm_s, extruder, millimeters
@@ -835,9 +835,9 @@ class Planner {
835 835
      *
836 836
      * Clears previous speed values.
837 837
      */
838
-    static void set_position_mm(const float &rx, const float &ry, const float &rz, const float &e);
838
+    static void set_position_mm(const_float_t rx, const_float_t ry, const_float_t rz, const_float_t e);
839 839
     FORCE_INLINE static void set_position_mm(const xyze_pos_t &cart) { set_position_mm(cart.x, cart.y, cart.z, cart.e); }
840
-    static void set_e_position_mm(const float &e);
840
+    static void set_e_position_mm(const_float_t e);
841 841
 
842 842
     /**
843 843
      * Set the planner.position and individual stepper positions.
@@ -845,7 +845,7 @@ class Planner {
845 845
      * The supplied position is in machine space, and no additional
846 846
      * conversions are applied.
847 847
      */
848
-    static void set_machine_position_mm(const float &a, const float &b, const float &c, const float &e);
848
+    static void set_machine_position_mm(const_float_t a, const_float_t b, const_float_t c, const_float_t e);
849 849
     FORCE_INLINE static void set_machine_position_mm(const abce_pos_t &abce) { set_machine_position_mm(abce.a, abce.b, abce.c, abce.e); }
850 850
 
851 851
     /**
@@ -957,7 +957,7 @@ class Planner {
957 957
      * Calculate the distance (not time) it takes to accelerate
958 958
      * from initial_rate to target_rate using the given acceleration:
959 959
      */
960
-    static float estimate_acceleration_distance(const float &initial_rate, const float &target_rate, const float &accel) {
960
+    static float estimate_acceleration_distance(const_float_t initial_rate, const_float_t target_rate, const_float_t accel) {
961 961
       if (accel == 0) return 0; // accel was 0, set acceleration distance to 0
962 962
       return (sq(target_rate) - sq(initial_rate)) / (accel * 2);
963 963
     }
@@ -970,7 +970,7 @@ class Planner {
970 970
      * This is used to compute the intersection point between acceleration and deceleration
971 971
      * in cases where the "trapezoid" has no plateau (i.e., never reaches maximum speed)
972 972
      */
973
-    static float intersection_distance(const float &initial_rate, const float &final_rate, const float &accel, const float &distance) {
973
+    static float intersection_distance(const_float_t initial_rate, const_float_t final_rate, const_float_t accel, const_float_t distance) {
974 974
       if (accel == 0) return 0; // accel was 0, set intersection distance to 0
975 975
       return (accel * 2 * distance - sq(initial_rate) + sq(final_rate)) / (accel * 4);
976 976
     }
@@ -980,7 +980,7 @@ class Planner {
980 980
      * to reach 'target_velocity_sqr' using 'acceleration' within a given
981 981
      * 'distance'.
982 982
      */
983
-    static float max_allowable_speed_sqr(const float &accel, const float &target_velocity_sqr, const float &distance) {
983
+    static float max_allowable_speed_sqr(const_float_t accel, const_float_t target_velocity_sqr, const_float_t distance) {
984 984
       return target_velocity_sqr - 2 * accel * distance;
985 985
     }
986 986
 
@@ -988,12 +988,12 @@ class Planner {
988 988
       /**
989 989
        * Calculate the speed reached given initial speed, acceleration and distance
990 990
        */
991
-      static float final_speed(const float &initial_velocity, const float &accel, const float &distance) {
991
+      static float final_speed(const_float_t initial_velocity, const_float_t accel, const_float_t distance) {
992 992
         return SQRT(sq(initial_velocity) + 2 * accel * distance);
993 993
       }
994 994
     #endif
995 995
 
996
-    static void calculate_trapezoid_for_block(block_t * const block, const float &entry_factor, const float &exit_factor);
996
+    static void calculate_trapezoid_for_block(block_t * const block, const_float_t entry_factor, const_float_t exit_factor);
997 997
 
998 998
     static void reverse_pass_kernel(block_t * const current, const block_t * const next);
999 999
     static void forward_pass_kernel(const block_t * const previous, block_t * const current, uint8_t block_index);
@@ -1013,7 +1013,7 @@ class Planner {
1013 1013
         vector *= RSQRT(magnitude_sq);
1014 1014
       }
1015 1015
 
1016
-      FORCE_INLINE static float limit_value_by_axis_maximum(const float &max_value, xyze_float_t &unit_vec) {
1016
+      FORCE_INLINE static float limit_value_by_axis_maximum(const_float_t max_value, xyze_float_t &unit_vec) {
1017 1017
         float limit_value = max_value;
1018 1018
         LOOP_XYZE(idx) {
1019 1019
           if (unit_vec[idx]) {

+ 4
- 4
Marlin/src/module/planner_bezier.cpp Просмотреть файл

@@ -43,7 +43,7 @@
43 43
 #define SIGMA 0.1f
44 44
 
45 45
 // Compute the linear interpolation between two real numbers.
46
-static inline float interp(const float &a, const float &b, const float &t) { return (1 - t) * a + t * b; }
46
+static inline float interp(const_float_t a, const_float_t b, const_float_t t) { return (1 - t) * a + t * b; }
47 47
 
48 48
 /**
49 49
  * Compute a Bézier curve using the De Casteljau's algorithm (see
@@ -51,7 +51,7 @@ static inline float interp(const float &a, const float &b, const float &t) { ret
51 51
  * easy to code and has good numerical stability (very important,
52 52
  * since Arudino works with limited precision real numbers).
53 53
  */
54
-static inline float eval_bezier(const float &a, const float &b, const float &c, const float &d, const float &t) {
54
+static inline float eval_bezier(const_float_t a, const_float_t b, const_float_t c, const_float_t d, const_float_t t) {
55 55
   const float iab = interp(a, b, t),
56 56
               ibc = interp(b, c, t),
57 57
               icd = interp(c, d, t),
@@ -64,7 +64,7 @@ static inline float eval_bezier(const float &a, const float &b, const float &c,
64 64
  * We approximate Euclidean distance with the sum of the coordinates
65 65
  * offset (so-called "norm 1"), which is quicker to compute.
66 66
  */
67
-static inline float dist1(const float &x1, const float &y1, const float &x2, const float &y2) { return ABS(x1 - x2) + ABS(y1 - y2); }
67
+static inline float dist1(const_float_t x1, const_float_t y1, const_float_t x2, const_float_t y2) { return ABS(x1 - x2) + ABS(y1 - y2); }
68 68
 
69 69
 /**
70 70
  * The algorithm for computing the step is loosely based on the one in Kig
@@ -109,7 +109,7 @@ void cubic_b_spline(
109 109
   const xyze_pos_t &position,       // current position
110 110
   const xyze_pos_t &target,         // target position
111 111
   const xy_pos_t (&offsets)[2],     // a pair of offsets
112
-  const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate %
112
+  const_feedRate_t scaled_fr_mm_s,  // mm/s scaled by feedrate %
113 113
   const uint8_t extruder
114 114
 ) {
115 115
   // Absolute first and second control points are recovered.

+ 1
- 1
Marlin/src/module/planner_bezier.h Просмотреть файл

@@ -33,6 +33,6 @@ void cubic_b_spline(
33 33
   const xyze_pos_t &position,       // current position
34 34
   const xyze_pos_t &target,         // target position
35 35
   const xy_pos_t (&offsets)[2],     // a pair of offsets
36
-  const feedRate_t &scaled_fr_mm_s, // mm/s scaled by feedrate %
36
+  const_feedRate_t scaled_fr_mm_s,  // mm/s scaled by feedrate %
37 37
   const uint8_t extruder
38 38
 );

+ 3
- 3
Marlin/src/module/probe.cpp Просмотреть файл

@@ -475,7 +475,7 @@ bool Probe::set_deployed(const bool deploy) {
475 475
  *
476 476
  * @return TRUE if the probe failed to trigger.
477 477
  */
478
-bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
478
+bool Probe::probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s) {
479 479
   DEBUG_SECTION(log_probe, "Probe::probe_down_to_z", DEBUGGING(LEVELING));
480 480
 
481 481
   #if BOTH(HAS_HEATED_BED, WAIT_FOR_BED_HEATER)
@@ -588,7 +588,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
588 588
 float Probe::run_z_probe(const bool sanity_check/*=true*/) {
589 589
   DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING));
590 590
 
591
-  auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) -> bool {
591
+  auto try_to_probe = [&](PGM_P const plbl, const_float_t z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) -> bool {
592 592
     // Tare the probe, if supported
593 593
     if (TERN0(PROBE_TARE, tare())) return true;
594 594
 
@@ -743,7 +743,7 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
743 743
  *   - Raise to the BETWEEN height
744 744
  * - Return the probed Z position
745 745
  */
746
-float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/) {
746
+float Probe::probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after/*=PROBE_PT_NONE*/, const uint8_t verbose_level/*=0*/, const bool probe_relative/*=true*/, const bool sanity_check/*=true*/) {
747 747
   DEBUG_SECTION(log_probe, "Probe::probe_at_point", DEBUGGING(LEVELING));
748 748
 
749 749
   if (DEBUGGING(LEVELING)) {

+ 6
- 6
Marlin/src/module/probe.h Просмотреть файл

@@ -71,12 +71,12 @@ public:
71 71
       #if HAS_PROBE_XY_OFFSET
72 72
         // Return true if the both nozzle and the probe can reach the given point.
73 73
         // Note: This won't work on SCARA since the probe offset rotates with the arm.
74
-        static bool can_reach(const float &rx, const float &ry) {
74
+        static bool can_reach(const_float_t rx, const_float_t ry) {
75 75
           return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y) // The nozzle can go where it needs to go?
76 76
               && position_is_reachable(rx, ry, ABS(PROBING_MARGIN));       // Can the nozzle also go near there?
77 77
         }
78 78
       #else
79
-        static bool can_reach(const float &rx, const float &ry) {
79
+        static bool can_reach(const_float_t rx, const_float_t ry) {
80 80
           return position_is_reachable(rx, ry, PROBING_MARGIN);
81 81
         }
82 82
       #endif
@@ -90,7 +90,7 @@ public:
90 90
        * Example: For a probe offset of -10,+10, then for the probe to reach 0,0 the
91 91
        *          nozzle must be be able to reach +10,-10.
92 92
        */
93
-      static bool can_reach(const float &rx, const float &ry) {
93
+      static bool can_reach(const_float_t rx, const_float_t ry) {
94 94
         return position_is_reachable(rx - offset_xy.x, ry - offset_xy.y)
95 95
             && COORDINATE_OKAY(rx, min_x() - fslop, max_x() + fslop)
96 96
             && COORDINATE_OKAY(ry, min_y() - fslop, max_y() + fslop);
@@ -103,7 +103,7 @@ public:
103 103
         do_z_clearance(Z_AFTER_PROBING, true); // Move down still permitted
104 104
       #endif
105 105
     }
106
-    static float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true);
106
+    static float probe_at_point(const_float_t rx, const_float_t ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true);
107 107
     static float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) {
108 108
       return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative, sanity_check);
109 109
     }
@@ -114,7 +114,7 @@ public:
114 114
 
115 115
     static bool set_deployed(const bool) { return false; }
116 116
 
117
-    static bool can_reach(const float &rx, const float &ry) { return position_is_reachable(rx, ry); }
117
+    static bool can_reach(const_float_t rx, const_float_t ry) { return position_is_reachable(rx, ry); }
118 118
 
119 119
   #endif
120 120
 
@@ -257,7 +257,7 @@ public:
257 257
   #endif
258 258
 
259 259
 private:
260
-  static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s);
260
+  static bool probe_down_to_z(const_float_t z, const_feedRate_t fr_mm_s);
261 261
   static void do_z_raise(const float z_raise);
262 262
   static float run_z_probe(const bool sanity_check=true);
263 263
 };

+ 2
- 2
Marlin/src/module/scara.cpp Просмотреть файл

@@ -48,7 +48,7 @@ float segments_per_second = TERN(AXEL_TPARA, TPARA_SEGMENTS_PER_SECOND, SCARA_SE
48 48
    * Maths and first version by QHARLEY.
49 49
    * Integrated into Marlin and slightly restructured by Joachim Cerny.
50 50
    */
51
-  void forward_kinematics(const float &a, const float &b) {
51
+  void forward_kinematics(const_float_t a, const_float_t b) {
52 52
     const float a_sin = sin(RADIANS(a)) * L1,
53 53
                 a_cos = cos(RADIANS(a)) * L1,
54 54
                 b_sin = sin(RADIANS(b + TERN0(MP_SCARA, a))) * L2,
@@ -197,7 +197,7 @@ float segments_per_second = TERN(AXEL_TPARA, TPARA_SEGMENTS_PER_SECOND, SCARA_SE
197 197
   }
198 198
 
199 199
   // Convert ABC inputs in degrees to XYZ outputs in mm
200
-  void forward_kinematics(const float &a, const float &b, const float &c) {
200
+  void forward_kinematics(const_float_t a, const_float_t b, const_float_t c) {
201 201
     const float w = c - b,
202 202
                 r = L1 * cos(RADIANS(b)) + L2 * sin(RADIANS(w - (90 - b))),
203 203
                 x = r  * cos(RADIANS(a)),

+ 2
- 2
Marlin/src/module/scara.h Просмотреть файл

@@ -35,7 +35,7 @@ extern float segments_per_second;
35 35
                   L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2,
36 36
                   L2_2 = sq(float(L2));
37 37
 
38
-  void forward_kinematics(const float &a, const float &b, const float &c);
38
+  void forward_kinematics(const_float_t a, const_float_t b, const_float_t c);
39 39
   void home_TPARA();
40 40
 
41 41
 #else
@@ -44,7 +44,7 @@ extern float segments_per_second;
44 44
                   L1_2 = sq(float(L1)), L1_2_2 = 2.0 * L1_2,
45 45
                   L2_2 = sq(float(L2));
46 46
 
47
-  void forward_kinematics(const float &a, const float &b);
47
+  void forward_kinematics(const_float_t a, const_float_t b);
48 48
 
49 49
 #endif
50 50
 

+ 4
- 4
Marlin/src/module/temperature.cpp Просмотреть файл

@@ -499,7 +499,7 @@ volatile bool Temperature::raw_temps_ready = false;
499 499
    * Needs sufficient heater power to make some overshoot at target
500 500
    * temperature to succeed.
501 501
    */
502
-  void Temperature::PID_autotune(const float &target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result/*=false*/) {
502
+  void Temperature::PID_autotune(const_float_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result/*=false*/) {
503 503
     float current_temp = 0.0;
504 504
     int cycles = 0;
505 505
     bool heating = true;
@@ -2336,7 +2336,7 @@ void Temperature::init() {
2336 2336
    *
2337 2337
    * TODO: Embed the last 3 parameters during init, if not less optimal
2338 2338
    */
2339
-  void Temperature::tr_state_machine_t::run(const float &current, const float &target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc) {
2339
+  void Temperature::tr_state_machine_t::run(const_float_t current, const_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc) {
2340 2340
 
2341 2341
     #if HEATER_IDLE_HANDLER
2342 2342
       // Convert the given heater_id_t to an idle array index
@@ -3371,7 +3371,7 @@ void Temperature::tick() {
3371 3371
 
3372 3372
   #include "../gcode/gcode.h"
3373 3373
 
3374
-  static void print_heater_state(const float &c, const float &t
3374
+  static void print_heater_state(const_float_t c, const_float_t t
3375 3375
     #if ENABLED(SHOW_TEMP_ADC_VALUES)
3376 3376
       , const float r
3377 3377
     #endif
@@ -3804,7 +3804,7 @@ void Temperature::tick() {
3804 3804
       #define MIN_DELTA_SLOPE_TIME_PROBE 600
3805 3805
     #endif
3806 3806
 
3807
-    bool Temperature::wait_for_probe(const float target_temp, bool no_wait_for_cooling/*=true*/) {
3807
+    bool Temperature::wait_for_probe(const_float_t target_temp, bool no_wait_for_cooling/*=true*/) {
3808 3808
 
3809 3809
       const bool wants_to_cool = isProbeAboveTemp(target_temp);
3810 3810
       const bool will_wait = !(wants_to_cool && no_wait_for_cooling);

+ 7
- 7
Marlin/src/module/temperature.h Просмотреть файл

@@ -688,7 +688,7 @@ class Temperature {
688 688
         return degTargetHotend(e) > TEMP_HYSTERESIS && ABS(degHotend(e) - degTargetHotend(e)) > TEMP_HYSTERESIS;
689 689
       }
690 690
 
691
-      FORCE_INLINE static bool degHotendNear(const uint8_t e, const float &temp) {
691
+      FORCE_INLINE static bool degHotendNear(const uint8_t e, const_float_t temp) {
692 692
         return ABS(degHotend(e) - temp) < (TEMP_HYSTERESIS);
693 693
       }
694 694
 
@@ -724,7 +724,7 @@ class Temperature {
724 724
 
725 725
       static void wait_for_bed_heating();
726 726
 
727
-      FORCE_INLINE static bool degBedNear(const float &temp) {
727
+      FORCE_INLINE static bool degBedNear(const_float_t temp) {
728 728
         return ABS(degBed() - temp) < (TEMP_BED_HYSTERESIS);
729 729
       }
730 730
 
@@ -735,9 +735,9 @@ class Temperature {
735 735
         FORCE_INLINE static int16_t rawProbeTemp()    { return temp_probe.raw; }
736 736
       #endif
737 737
       FORCE_INLINE static float degProbe()            { return temp_probe.celsius; }
738
-      FORCE_INLINE static bool isProbeBelowTemp(const float target_temp) { return temp_probe.celsius < target_temp; }
739
-      FORCE_INLINE static bool isProbeAboveTemp(const float target_temp) { return temp_probe.celsius > target_temp; }
740
-      static bool wait_for_probe(const float target_temp, bool no_wait_for_cooling=true);
738
+      FORCE_INLINE static bool isProbeBelowTemp(const_float_t target_temp) { return temp_probe.celsius < target_temp; }
739
+      FORCE_INLINE static bool isProbeAboveTemp(const_float_t target_temp) { return temp_probe.celsius > target_temp; }
740
+      static bool wait_for_probe(const_float_t target_temp, bool no_wait_for_cooling=true);
741 741
     #endif
742 742
 
743 743
     #if WATCH_PROBE
@@ -825,7 +825,7 @@ class Temperature {
825 825
         static bool pid_debug_flag;
826 826
       #endif
827 827
 
828
-      static void PID_autotune(const float &target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false);
828
+      static void PID_autotune(const_float_t target, const heater_id_t heater_id, const int8_t ncycles, const bool set_result=false);
829 829
 
830 830
       #if ENABLED(NO_FAN_SLOWING_IN_PID_TUNING)
831 831
         static bool adaptive_fan_slowing;
@@ -959,7 +959,7 @@ class Temperature {
959 959
         millis_t timer = 0;
960 960
         TRState state = TRInactive;
961 961
         float running_temp;
962
-        void run(const float &current, const float &target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc);
962
+        void run(const_float_t current, const_float_t target, const heater_id_t heater_id, const uint16_t period_seconds, const celsius_t hysteresis_degc);
963 963
       } tr_state_machine_t;
964 964
 
965 965
       static tr_state_machine_t tr_state_machine[NR_HEATER_RUNAWAY];

Загрузка…
Отмена
Сохранить