Kaynağa Gözat

Merge pull request #6368 from thinkyhead/rc_linear_advance_eeprom

Add Linear Advance values to EEPROM and LCD
Scott Lahteine 7 yıl önce
ebeveyn
işleme
f33a650ecc
58 değiştirilmiş dosya ile 726 ekleme ve 546 silme
  1. 4
    2
      Marlin/Configuration_adv.h
  2. 88
    86
      Marlin/Marlin_main.cpp
  3. 224
    158
      Marlin/configuration_store.cpp
  4. 4
    2
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  5. 4
    2
      Marlin/example_configurations/Felix/Configuration_adv.h
  6. 4
    2
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  7. 4
    2
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  8. 4
    2
      Marlin/example_configurations/K8200/Configuration_adv.h
  9. 4
    2
      Marlin/example_configurations/K8400/Configuration_adv.h
  10. 4
    2
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  11. 4
    2
      Marlin/example_configurations/SCARA/Configuration_adv.h
  12. 4
    2
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  13. 4
    2
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  14. 4
    2
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  15. 4
    2
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  16. 4
    2
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  17. 4
    2
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  18. 4
    2
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  19. 4
    2
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  20. 4
    2
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  21. 4
    2
      Marlin/example_configurations/makibox/Configuration_adv.h
  22. 4
    2
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  23. 4
    2
      Marlin/example_configurations/wt150/Configuration_adv.h
  24. 1
    1
      Marlin/language_an.h
  25. 1
    1
      Marlin/language_bg.h
  26. 1
    1
      Marlin/language_ca.h
  27. 1
    1
      Marlin/language_cn.h
  28. 1
    1
      Marlin/language_cz.h
  29. 1
    1
      Marlin/language_da.h
  30. 1
    1
      Marlin/language_de.h
  31. 1
    1
      Marlin/language_el-gr.h
  32. 1
    1
      Marlin/language_el.h
  33. 5
    2
      Marlin/language_en.h
  34. 1
    1
      Marlin/language_es.h
  35. 1
    1
      Marlin/language_eu.h
  36. 1
    1
      Marlin/language_fi.h
  37. 1
    1
      Marlin/language_fr.h
  38. 1
    1
      Marlin/language_gl.h
  39. 1
    1
      Marlin/language_hr.h
  40. 1
    1
      Marlin/language_it.h
  41. 1
    1
      Marlin/language_kana.h
  42. 1
    1
      Marlin/language_kana_utf8.h
  43. 1
    1
      Marlin/language_nl.h
  44. 1
    1
      Marlin/language_pl.h
  45. 1
    1
      Marlin/language_pt-br.h
  46. 1
    1
      Marlin/language_pt-br_utf8.h
  47. 1
    1
      Marlin/language_pt.h
  48. 1
    1
      Marlin/language_pt_utf8.h
  49. 1
    1
      Marlin/language_ru.h
  50. 3
    3
      Marlin/language_test.h
  51. 1
    1
      Marlin/language_tr.h
  52. 1
    1
      Marlin/language_uk.h
  53. 1
    1
      Marlin/language_zh_CN.h
  54. 1
    1
      Marlin/language_zh_TW.h
  55. 3
    2
      Marlin/planner.h
  56. 244
    185
      Marlin/ultralcd.cpp
  57. 23
    19
      Marlin/ultralcd_impl_DOGM.h
  58. 23
    20
      Marlin/ultralcd_impl_HD44780.h

+ 4
- 2
Marlin/Configuration_adv.h Dosyayı Görüntüle

@@ -633,13 +633,15 @@
633 633
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
634 634
    * if the slicer is using variable widths or layer heights within one print!
635 635
    *
636
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
636
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
637 637
    *
638
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
638
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
639 639
    *   - W is the extrusion width in mm
640 640
    *   - H is the layer height in mm
641 641
    *   - D is the filament diameter in mm
642 642
    *
643
+   * Example: `M900 R0.0458` to set the ratio directly.
644
+   *
643 645
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
644 646
    *
645 647
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 88
- 86
Marlin/Marlin_main.cpp Dosyayı Görüntüle

@@ -1285,19 +1285,19 @@ inline bool code_value_bool() { return !code_has_value() || code_value_byte() >
1285 1285
     volumetric_unit_factor = pow(linear_unit_factor, 3.0);
1286 1286
   }
1287 1287
 
1288
-  inline float axis_unit_factor(int axis) {
1288
+  inline float axis_unit_factor(const AxisEnum axis) {
1289 1289
     return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
1290 1290
   }
1291 1291
 
1292 1292
   inline float code_value_linear_units() { return code_value_float() * linear_unit_factor; }
1293
-  inline float code_value_axis_units(int axis) { return code_value_float() * axis_unit_factor(axis); }
1294
-  inline float code_value_per_axis_unit(int axis) { return code_value_float() / axis_unit_factor(axis); }
1293
+  inline float code_value_axis_units(const AxisEnum axis) { return code_value_float() * axis_unit_factor(axis); }
1294
+  inline float code_value_per_axis_unit(const AxisEnum axis) { return code_value_float() / axis_unit_factor(axis); }
1295 1295
 
1296 1296
 #else
1297 1297
 
1298
-  inline float code_value_linear_units() { return code_value_float(); }
1299
-  inline float code_value_axis_units(int axis) { UNUSED(axis); return code_value_float(); }
1300
-  inline float code_value_per_axis_unit(int axis) { UNUSED(axis); return code_value_float(); }
1298
+  #define code_value_linear_units() code_value_float()
1299
+  #define code_value_axis_units(A) code_value_float()
1300
+  #define code_value_per_axis_unit(A) code_value_float()
1301 1301
 
1302 1302
 #endif
1303 1303
 
@@ -3063,7 +3063,7 @@ static void homeaxis(const AxisEnum axis) {
3063 3063
 void gcode_get_destination() {
3064 3064
   LOOP_XYZE(i) {
3065 3065
     if (code_seen(axis_codes[i]))
3066
-      destination[i] = code_value_axis_units(i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
3066
+      destination[i] = code_value_axis_units((AxisEnum)i) + (axis_relative_modes[i] || relative_mode ? current_position[i] : 0);
3067 3067
     else
3068 3068
       destination[i] = current_position[i];
3069 3069
   }
@@ -3232,7 +3232,7 @@ inline void gcode_G0_G1(
3232 3232
 
3233 3233
       float arc_offset[2] = { 0.0, 0.0 };
3234 3234
       if (code_seen('R')) {
3235
-        const float r = code_value_axis_units(X_AXIS),
3235
+        const float r = code_value_linear_units(),
3236 3236
                     x1 = current_position[X_AXIS], y1 = current_position[Y_AXIS],
3237 3237
                     x2 = destination[X_AXIS], y2 = destination[Y_AXIS];
3238 3238
         if (r && (x2 != x1 || y2 != y1)) {
@@ -3248,8 +3248,8 @@ inline void gcode_G0_G1(
3248 3248
         }
3249 3249
       }
3250 3250
       else {
3251
-        if (code_seen('I')) arc_offset[X_AXIS] = code_value_axis_units(X_AXIS);
3252
-        if (code_seen('J')) arc_offset[Y_AXIS] = code_value_axis_units(Y_AXIS);
3251
+        if (code_seen('I')) arc_offset[X_AXIS] = code_value_linear_units();
3252
+        if (code_seen('J')) arc_offset[Y_AXIS] = code_value_linear_units();
3253 3253
       }
3254 3254
 
3255 3255
       if (arc_offset[0] || arc_offset[1]) {
@@ -3302,10 +3302,10 @@ inline void gcode_G4() {
3302 3302
       gcode_get_destination();
3303 3303
 
3304 3304
       const float offset[] = {
3305
-        code_seen('I') ? code_value_axis_units(X_AXIS) : 0.0,
3306
-        code_seen('J') ? code_value_axis_units(Y_AXIS) : 0.0,
3307
-        code_seen('P') ? code_value_axis_units(X_AXIS) : 0.0,
3308
-        code_seen('Q') ? code_value_axis_units(Y_AXIS) : 0.0
3305
+        code_seen('I') ? code_value_linear_units() : 0.0,
3306
+        code_seen('J') ? code_value_linear_units() : 0.0,
3307
+        code_seen('P') ? code_value_linear_units() : 0.0,
3308
+        code_seen('Q') ? code_value_linear_units() : 0.0
3309 3309
       };
3310 3310
 
3311 3311
       plan_cubic_move(offset);
@@ -4023,7 +4023,7 @@ inline void gcode_G28() {
4023 4023
         }
4024 4024
 
4025 4025
         if (code_seen('Z')) {
4026
-          mbl.z_values[px][py] = code_value_axis_units(Z_AXIS);
4026
+          mbl.z_values[px][py] = code_value_linear_units();
4027 4027
         }
4028 4028
         else {
4029 4029
           SERIAL_CHAR('Z'); say_not_entered();
@@ -4033,7 +4033,7 @@ inline void gcode_G28() {
4033 4033
 
4034 4034
       case MeshSetZOffset:
4035 4035
         if (code_seen('Z')) {
4036
-          mbl.z_offset = code_value_axis_units(Z_AXIS);
4036
+          mbl.z_offset = code_value_linear_units();
4037 4037
         }
4038 4038
         else {
4039 4039
           SERIAL_CHAR('Z'); say_not_entered();
@@ -4305,7 +4305,7 @@ inline void gcode_G28() {
4305 4305
 
4306 4306
       #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
4307 4307
 
4308
-        zoffset = code_seen('Z') ? code_value_axis_units(Z_AXIS) : 0;
4308
+        zoffset = code_seen('Z') ? code_value_linear_units() : 0;
4309 4309
 
4310 4310
       #endif
4311 4311
 
@@ -4313,10 +4313,10 @@ inline void gcode_G28() {
4313 4313
 
4314 4314
         xy_probe_feedrate_mm_s = MMM_TO_MMS(code_seen('S') ? code_value_linear_units() : XY_PROBE_SPEED);
4315 4315
 
4316
-        left_probe_bed_position = code_seen('L') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(LEFT_PROBE_BED_POSITION);
4317
-        right_probe_bed_position = code_seen('R') ? (int)code_value_axis_units(X_AXIS) : LOGICAL_X_POSITION(RIGHT_PROBE_BED_POSITION);
4318
-        front_probe_bed_position = code_seen('F') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(FRONT_PROBE_BED_POSITION);
4319
-        back_probe_bed_position = code_seen('B') ? (int)code_value_axis_units(Y_AXIS) : LOGICAL_Y_POSITION(BACK_PROBE_BED_POSITION);
4316
+        left_probe_bed_position = code_seen('L') ? (int)code_value_linear_units() : LOGICAL_X_POSITION(LEFT_PROBE_BED_POSITION);
4317
+        right_probe_bed_position = code_seen('R') ? (int)code_value_linear_units() : LOGICAL_X_POSITION(RIGHT_PROBE_BED_POSITION);
4318
+        front_probe_bed_position = code_seen('F') ? (int)code_value_linear_units() : LOGICAL_Y_POSITION(FRONT_PROBE_BED_POSITION);
4319
+        back_probe_bed_position = code_seen('B') ? (int)code_value_linear_units() : LOGICAL_Y_POSITION(BACK_PROBE_BED_POSITION);
4320 4320
 
4321 4321
         const bool left_out_l = left_probe_bed_position < LOGICAL_X_POSITION(MIN_PROBE_X),
4322 4322
                    left_out = left_out_l || left_probe_bed_position > right_probe_bed_position - (MIN_PROBE_EDGE),
@@ -4927,8 +4927,8 @@ inline void gcode_G28() {
4927 4927
    *     S = Stows the probe if 1 (default=1)
4928 4928
    */
4929 4929
   inline void gcode_G30() {
4930
-    float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
4931
-          Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
4930
+    float X_probe_location = code_seen('X') ? code_value_linear_units() : current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER,
4931
+          Y_probe_location = code_seen('Y') ? code_value_linear_units() : current_position[Y_AXIS] + Y_PROBE_OFFSET_FROM_EXTRUDER;
4932 4932
 
4933 4933
     float pos[XYZ] = { X_probe_location, Y_probe_location, LOGICAL_Z_POSITION(0) };
4934 4934
     if (!position_is_reachable(pos, true)) return;
@@ -5431,13 +5431,13 @@ inline void gcode_G92() {
5431 5431
   LOOP_XYZE(i) {
5432 5432
     if (code_seen(axis_codes[i])) {
5433 5433
       #if IS_SCARA
5434
-        current_position[i] = code_value_axis_units(i);
5434
+        current_position[i] = code_value_axis_units((AxisEnum)i);
5435 5435
         if (i != E_AXIS) didXYZ = true;
5436 5436
       #else
5437 5437
         #if HAS_POSITION_SHIFT
5438
-          float p = current_position[i];
5438
+          const float p = current_position[i];
5439 5439
         #endif
5440
-        float v = code_value_axis_units(i);
5440
+        float v = code_value_axis_units((AxisEnum)i);
5441 5441
 
5442 5442
         current_position[i] = v;
5443 5443
 
@@ -6078,7 +6078,7 @@ inline void gcode_M42() {
6078 6078
 
6079 6079
     bool stow_probe_after_each = code_seen('E');
6080 6080
 
6081
-    float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
6081
+    float X_probe_location = code_seen('X') ? code_value_linear_units() : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
6082 6082
     #if DISABLED(DELTA)
6083 6083
       if (!WITHIN(X_probe_location, LOGICAL_X_POSITION(MIN_PROBE_X), LOGICAL_X_POSITION(MAX_PROBE_X))) {
6084 6084
         out_of_range_error(PSTR("X"));
@@ -6086,7 +6086,7 @@ inline void gcode_M42() {
6086 6086
       }
6087 6087
     #endif
6088 6088
 
6089
-    float Y_probe_location = code_seen('Y') ? code_value_axis_units(Y_AXIS) : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER;
6089
+    float Y_probe_location = code_seen('Y') ? code_value_linear_units() : Y_current + Y_PROBE_OFFSET_FROM_EXTRUDER;
6090 6090
     #if DISABLED(DELTA)
6091 6091
       if (!WITHIN(Y_probe_location, LOGICAL_Y_POSITION(MIN_PROBE_Y), LOGICAL_Y_POSITION(MAX_PROBE_Y))) {
6092 6092
         out_of_range_error(PSTR("Y"));
@@ -7063,7 +7063,7 @@ inline void gcode_M92() {
7063 7063
   LOOP_XYZE(i) {
7064 7064
     if (code_seen(axis_codes[i])) {
7065 7065
       if (i == E_AXIS) {
7066
-        float value = code_value_per_axis_unit(E_AXIS + TARGET_EXTRUDER);
7066
+        const float value = code_value_per_axis_unit(E_AXIS + TARGET_EXTRUDER);
7067 7067
         if (value < 20.0) {
7068 7068
           float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab.
7069 7069
           planner.max_jerk[E_AXIS] *= factor;
@@ -7250,7 +7250,7 @@ inline void gcode_M121() { endstops.enable_globally(false); }
7250 7250
     RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE);
7251 7251
 
7252 7252
     // Lift Z axis
7253
-    const float z_lift = code_seen('Z') ? code_value_axis_units(Z_AXIS) :
7253
+    const float z_lift = code_seen('Z') ? code_value_linear_units() :
7254 7254
       #if defined(FILAMENT_CHANGE_Z_ADD) && FILAMENT_CHANGE_Z_ADD > 0
7255 7255
         FILAMENT_CHANGE_Z_ADD
7256 7256
       #else
@@ -7264,12 +7264,12 @@ inline void gcode_M121() { endstops.enable_globally(false); }
7264 7264
     }
7265 7265
 
7266 7266
     // Move XY axes to filament change position or given position
7267
-    destination[X_AXIS] = code_seen('X') ? code_value_axis_units(X_AXIS) : 0
7267
+    destination[X_AXIS] = code_seen('X') ? code_value_linear_units() : 0
7268 7268
       #ifdef FILAMENT_CHANGE_X_POS
7269 7269
         + FILAMENT_CHANGE_X_POS
7270 7270
       #endif
7271 7271
     ;
7272
-    destination[Y_AXIS] = code_seen('Y') ? code_value_axis_units(Y_AXIS) : 0
7272
+    destination[Y_AXIS] = code_seen('Y') ? code_value_linear_units() : 0
7273 7273
       #ifdef FILAMENT_CHANGE_Y_POS
7274 7274
         + FILAMENT_CHANGE_Y_POS
7275 7275
       #endif
@@ -7355,10 +7355,6 @@ inline void gcode_M200() {
7355 7355
         if (! filament_size[i]) filament_size[i] = DEFAULT_NOMINAL_FILAMENT_DIA;
7356 7356
     }
7357 7357
   }
7358
-  else {
7359
-    //reserved for setting filament diameter via UFID or filament measuring device
7360
-    return;
7361
-  }
7362 7358
   calculate_volumetric_multipliers();
7363 7359
 }
7364 7360
 
@@ -7374,7 +7370,7 @@ inline void gcode_M201() {
7374 7370
   LOOP_XYZE(i) {
7375 7371
     if (code_seen(axis_codes[i])) {
7376 7372
       const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
7377
-      planner.max_acceleration_mm_per_s2[a] = code_value_axis_units(a);
7373
+      planner.max_acceleration_mm_per_s2[a] = code_value_axis_units((AxisEnum)a);
7378 7374
     }
7379 7375
   }
7380 7376
   // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
@@ -7384,7 +7380,7 @@ inline void gcode_M201() {
7384 7380
 #if 0 // Not used for Sprinter/grbl gen6
7385 7381
   inline void gcode_M202() {
7386 7382
     LOOP_XYZE(i) {
7387
-      if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_mm[i];
7383
+      if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units((AxisEnum)i) * planner.axis_steps_per_mm[i];
7388 7384
     }
7389 7385
   }
7390 7386
 #endif
@@ -7402,7 +7398,7 @@ inline void gcode_M203() {
7402 7398
   LOOP_XYZE(i)
7403 7399
     if (code_seen(axis_codes[i])) {
7404 7400
       const uint8_t a = i + (i == E_AXIS ? TARGET_EXTRUDER : 0);
7405
-      planner.max_feedrate_mm_s[a] = code_value_axis_units(a);
7401
+      planner.max_feedrate_mm_s[a] = code_value_axis_units((AxisEnum)a);
7406 7402
     }
7407 7403
 }
7408 7404
 
@@ -7449,10 +7445,10 @@ inline void gcode_M205() {
7449 7445
   if (code_seen('S')) planner.min_feedrate_mm_s = code_value_linear_units();
7450 7446
   if (code_seen('T')) planner.min_travel_feedrate_mm_s = code_value_linear_units();
7451 7447
   if (code_seen('B')) planner.min_segment_time = code_value_millis();
7452
-  if (code_seen('X')) planner.max_jerk[X_AXIS] = code_value_axis_units(X_AXIS);
7453
-  if (code_seen('Y')) planner.max_jerk[Y_AXIS] = code_value_axis_units(Y_AXIS);
7454
-  if (code_seen('Z')) planner.max_jerk[Z_AXIS] = code_value_axis_units(Z_AXIS);
7455
-  if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_axis_units(E_AXIS);
7448
+  if (code_seen('X')) planner.max_jerk[X_AXIS] = code_value_linear_units();
7449
+  if (code_seen('Y')) planner.max_jerk[Y_AXIS] = code_value_linear_units();
7450
+  if (code_seen('Z')) planner.max_jerk[Z_AXIS] = code_value_linear_units();
7451
+  if (code_seen('E')) planner.max_jerk[E_AXIS] = code_value_linear_units();
7456 7452
 }
7457 7453
 
7458 7454
 #if HAS_M206_COMMAND
@@ -7463,11 +7459,11 @@ inline void gcode_M205() {
7463 7459
   inline void gcode_M206() {
7464 7460
     LOOP_XYZ(i)
7465 7461
       if (code_seen(axis_codes[i]))
7466
-        set_home_offset((AxisEnum)i, code_value_axis_units(i));
7462
+        set_home_offset((AxisEnum)i, code_value_linear_units());
7467 7463
 
7468 7464
     #if ENABLED(MORGAN_SCARA)
7469
-      if (code_seen('T')) set_home_offset(A_AXIS, code_value_axis_units(A_AXIS)); // Theta
7470
-      if (code_seen('P')) set_home_offset(B_AXIS, code_value_axis_units(B_AXIS)); // Psi
7465
+      if (code_seen('T')) set_home_offset(A_AXIS, code_value_linear_units()); // Theta
7466
+      if (code_seen('P')) set_home_offset(B_AXIS, code_value_linear_units()); // Psi
7471 7467
     #endif
7472 7468
 
7473 7469
     SYNC_PLAN_POSITION_KINEMATIC();
@@ -7517,7 +7513,7 @@ inline void gcode_M205() {
7517 7513
     #endif
7518 7514
     LOOP_XYZ(i) {
7519 7515
       if (code_seen(axis_codes[i])) {
7520
-        endstop_adj[i] = code_value_axis_units(i);
7516
+        endstop_adj[i] = code_value_linear_units();
7521 7517
         #if ENABLED(DEBUG_LEVELING_FEATURE)
7522 7518
           if (DEBUGGING(LEVELING)) {
7523 7519
             SERIAL_ECHOPAIR("endstop_adj[", axis_codes[i]);
@@ -7539,7 +7535,7 @@ inline void gcode_M205() {
7539 7535
    * M666: For Z Dual Endstop setup, set z axis offset to the z2 axis.
7540 7536
    */
7541 7537
   inline void gcode_M666() {
7542
-    if (code_seen('Z')) z_endstop_adj = code_value_axis_units(Z_AXIS);
7538
+    if (code_seen('Z')) z_endstop_adj = code_value_linear_units();
7543 7539
     SERIAL_ECHOLNPAIR("Z Endstop Adjustment set to (mm):", z_endstop_adj);
7544 7540
   }
7545 7541
 
@@ -7558,7 +7554,7 @@ inline void gcode_M205() {
7558 7554
   inline void gcode_M207() {
7559 7555
     if (code_seen('S')) retract_length = code_value_axis_units(E_AXIS);
7560 7556
     if (code_seen('F')) retract_feedrate_mm_s = MMM_TO_MMS(code_value_axis_units(E_AXIS));
7561
-    if (code_seen('Z')) retract_zlift = code_value_axis_units(Z_AXIS);
7557
+    if (code_seen('Z')) retract_zlift = code_value_linear_units();
7562 7558
     #if EXTRUDERS > 1
7563 7559
       if (code_seen('W')) retract_length_swap = code_value_axis_units(E_AXIS);
7564 7560
     #endif
@@ -7631,11 +7627,11 @@ inline void gcode_M211() {
7631 7627
   inline void gcode_M218() {
7632 7628
     if (get_target_extruder_from_command(218) || target_extruder == 0) return;
7633 7629
 
7634
-    if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_axis_units(X_AXIS);
7635
-    if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_axis_units(Y_AXIS);
7630
+    if (code_seen('X')) hotend_offset[X_AXIS][target_extruder] = code_value_linear_units();
7631
+    if (code_seen('Y')) hotend_offset[Y_AXIS][target_extruder] = code_value_linear_units();
7636 7632
 
7637 7633
     #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)
7638
-      if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value_axis_units(Z_AXIS);
7634
+      if (code_seen('Z')) hotend_offset[Z_AXIS][target_extruder] = code_value_linear_units();
7639 7635
     #endif
7640 7636
 
7641 7637
     SERIAL_ECHO_START;
@@ -8285,11 +8281,11 @@ void quickstop_stepper() {
8285 8281
     int8_t px = 0, py = 0;
8286 8282
     float z = 0;
8287 8283
     bool hasX, hasY, hasZ, hasI, hasJ;
8288
-    if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value_axis_units(X_AXIS));
8289
-    if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value_axis_units(Y_AXIS));
8290
-    if ((hasI = code_seen('I'))) px = code_value_axis_units(X_AXIS);
8291
-    if ((hasJ = code_seen('J'))) py = code_value_axis_units(Y_AXIS);
8292
-    if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
8284
+    if ((hasX = code_seen('X'))) px = mbl.probe_index_x(code_value_linear_units());
8285
+    if ((hasY = code_seen('Y'))) py = mbl.probe_index_y(code_value_linear_units());
8286
+    if ((hasI = code_seen('I'))) px = code_value_linear_units();
8287
+    if ((hasJ = code_seen('J'))) py = code_value_linear_units();
8288
+    if ((hasZ = code_seen('Z'))) z = code_value_linear_units();
8293 8289
 
8294 8290
     if (hasX && hasY && hasZ) {
8295 8291
 
@@ -8325,9 +8321,9 @@ void quickstop_stepper() {
8325 8321
     int8_t px = 0, py = 0;
8326 8322
     float z = 0;
8327 8323
     bool hasI, hasJ, hasZ;
8328
-    if ((hasI = code_seen('I'))) px = code_value_axis_units(X_AXIS);
8329
-    if ((hasJ = code_seen('J'))) py = code_value_axis_units(Y_AXIS);
8330
-    if ((hasZ = code_seen('Z'))) z = code_value_axis_units(Z_AXIS);
8324
+    if ((hasI = code_seen('I'))) px = code_value_linear_units();
8325
+    if ((hasJ = code_seen('J'))) py = code_value_linear_units();
8326
+    if ((hasZ = code_seen('Z'))) z = code_value_linear_units();
8331 8327
 
8332 8328
     if (hasI && hasJ && hasZ) {
8333 8329
       if (WITHIN(px, 0, GRID_MAX_POINTS_X - 1) && WITHIN(py, 0, GRID_MAX_POINTS_X - 1)) {
@@ -8474,7 +8470,7 @@ inline void gcode_M503() {
8474 8470
     SERIAL_ECHO_START;
8475 8471
     SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET " ");
8476 8472
     if (code_seen('Z')) {
8477
-      const float value = code_value_axis_units(Z_AXIS);
8473
+      const float value = code_value_linear_units();
8478 8474
       if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX)) {
8479 8475
         zprobe_zoffset = value;
8480 8476
         refresh_zprobe_zoffset();
@@ -8557,7 +8553,7 @@ inline void gcode_M503() {
8557 8553
     RUNPLAN(FILAMENT_CHANGE_RETRACT_FEEDRATE);
8558 8554
 
8559 8555
     // Lift Z axis
8560
-    float z_lift = code_seen('Z') ? code_value_axis_units(Z_AXIS) :
8556
+    float z_lift = code_seen('Z') ? code_value_linear_units() :
8561 8557
       #if defined(FILAMENT_CHANGE_Z_ADD) && FILAMENT_CHANGE_Z_ADD > 0
8562 8558
         FILAMENT_CHANGE_Z_ADD
8563 8559
       #else
@@ -8572,12 +8568,12 @@ inline void gcode_M503() {
8572 8568
     }
8573 8569
 
8574 8570
     // Move XY axes to filament exchange position
8575
-    if (code_seen('X')) destination[X_AXIS] = code_value_axis_units(X_AXIS);
8571
+    if (code_seen('X')) destination[X_AXIS] = code_value_linear_units();
8576 8572
     #ifdef FILAMENT_CHANGE_X_POS
8577 8573
       else destination[X_AXIS] = FILAMENT_CHANGE_X_POS;
8578 8574
     #endif
8579 8575
 
8580
-    if (code_seen('Y')) destination[Y_AXIS] = code_value_axis_units(Y_AXIS);
8576
+    if (code_seen('Y')) destination[Y_AXIS] = code_value_linear_units();
8581 8577
     #ifdef FILAMENT_CHANGE_Y_POS
8582 8578
       else destination[Y_AXIS] = FILAMENT_CHANGE_Y_POS;
8583 8579
     #endif
@@ -8766,7 +8762,7 @@ inline void gcode_M503() {
8766 8762
       case DXC_AUTO_PARK_MODE:
8767 8763
         break;
8768 8764
       case DXC_DUPLICATION_MODE:
8769
-        if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0));
8765
+        if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_linear_units(), X2_MIN_POS - x_home_pos(0));
8770 8766
         if (code_seen('R')) duplicate_extruder_temp_offset = code_value_temp_diff();
8771 8767
         SERIAL_ECHO_START;
8772 8768
         SERIAL_ECHOPGM(MSG_HOTEND_OFFSET);
@@ -8801,28 +8797,34 @@ inline void gcode_M503() {
8801 8797
 
8802 8798
 #if ENABLED(LIN_ADVANCE)
8803 8799
   /**
8804
-   * M905: Set advance factor
8800
+   * M900: Set and/or Get advance K factor and WH/D ratio
8801
+   *
8802
+   *  K<factor>                  Set advance K factor
8803
+   *  R<ratio>                   Set ratio directly (overrides WH/D)
8804
+   *  W<width> H<height> D<diam> Set ratio from WH/D
8805 8805
    */
8806
-  inline void gcode_M905() {
8806
+  inline void gcode_M900() {
8807 8807
     stepper.synchronize();
8808 8808
 
8809
-    const float newK = code_seen('K') ? code_value_float() : -1,
8810
-                newD = code_seen('D') ? code_value_float() : -1,
8811
-                newW = code_seen('W') ? code_value_float() : -1,
8812
-                newH = code_seen('H') ? code_value_float() : -1;
8809
+    const float newK = code_seen('K') ? code_value_float() : -1;
8810
+    if (newK >= 0) planner.set_extruder_advance_k(newK);
8813 8811
 
8814
-    if (newK >= 0.0) planner.set_extruder_advance_k(newK);
8812
+    float newR = code_seen('R') ? code_value_float() : -1;
8813
+    if (newR < 0) {
8814
+      const float newD = code_seen('D') ? code_value_float() : -1,
8815
+                  newW = code_seen('W') ? code_value_float() : -1,
8816
+                  newH = code_seen('H') ? code_value_float() : -1;
8817
+      if (newD >= 0 && newW >= 0 && newH >= 0)
8818
+        newR = newD ? (newW * newH) / (sq(newD * 0.5) * M_PI) : 0;
8819
+    }
8820
+    if (newR >= 0) planner.set_advance_ed_ratio(newR);
8815 8821
 
8816 8822
     SERIAL_ECHO_START;
8817
-    SERIAL_ECHOLNPAIR("Advance factor: ", planner.get_extruder_advance_k());
8818
-
8819
-    if (newD >= 0 || newW >= 0 || newH >= 0) {
8820
-      const float ratio = (!newD || !newW || !newH) ? 0 : (newW * newH) / (sq(newD * 0.5) * M_PI);
8821
-      planner.set_advance_ed_ratio(ratio);
8822
-      SERIAL_ECHO_START;
8823
-      SERIAL_ECHOPGM("E/D ratio: ");
8824
-      if (ratio) SERIAL_ECHOLN(ratio); else SERIAL_ECHOLNPGM("Automatic");
8825
-    }
8823
+    SERIAL_ECHOPAIR("Advance K=", planner.get_extruder_advance_k());
8824
+    SERIAL_ECHOPGM(" E/D=");
8825
+    const float ratio = planner.get_advance_ed_ratio();
8826
+    ratio ? SERIAL_ECHO(ratio) : SERIAL_ECHOPGM("Auto");
8827
+    SERIAL_EOL;
8826 8828
   }
8827 8829
 #endif // LIN_ADVANCE
8828 8830
 
@@ -9127,7 +9129,7 @@ inline void gcode_M355() {
9127 9129
    *
9128 9130
    */
9129 9131
   inline void gcode_M163() {
9130
-    int mix_index = code_seen('S') ? code_value_int() : 0;
9132
+    const int mix_index = code_seen('S') ? code_value_int() : 0;
9131 9133
     if (mix_index < MIXING_STEPPERS) {
9132 9134
       float mix_value = code_seen('P') ? code_value_float() : 0.0;
9133 9135
       NOLESS(mix_value, 0.0);
@@ -9144,7 +9146,7 @@ inline void gcode_M355() {
9144 9146
      *
9145 9147
      */
9146 9148
     inline void gcode_M164() {
9147
-      int tool_index = code_seen('S') ? code_value_int() : 0;
9149
+      const int tool_index = code_seen('S') ? code_value_int() : 0;
9148 9150
       if (tool_index < MIXING_VIRTUAL_TOOLS) {
9149 9151
         normalize_mix();
9150 9152
         for (uint8_t i = 0; i < MIXING_STEPPERS; i++)
@@ -9542,7 +9544,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
9542 9544
 
9543 9545
     tool_change(
9544 9546
       tmp_extruder,
9545
-      code_seen('F') ? MMM_TO_MMS(code_value_axis_units(X_AXIS)) : 0.0,
9547
+      code_seen('F') ? MMM_TO_MMS(code_value_linear_units()) : 0.0,
9546 9548
       (tmp_extruder == active_extruder) || (code_seen('S') && code_value_bool())
9547 9549
     );
9548 9550
 
@@ -10262,8 +10264,8 @@ void process_next_command() {
10262 10264
       #endif // DUAL_X_CARRIAGE
10263 10265
 
10264 10266
       #if ENABLED(LIN_ADVANCE)
10265
-        case 905: // M905: Set advance K factor.
10266
-          gcode_M905();
10267
+        case 900: // M900: Set advance K factor.
10268
+          gcode_M900();
10267 10269
           break;
10268 10270
       #endif
10269 10271
 

+ 224
- 158
Marlin/configuration_store.cpp Dosyayı Görüntüle

@@ -36,7 +36,7 @@
36 36
  *
37 37
  */
38 38
 
39
-#define EEPROM_VERSION "V34"
39
+#define EEPROM_VERSION "V35"
40 40
 
41 41
 // Change EEPROM version if these are changed:
42 42
 #define EEPROM_OFFSET 100
@@ -67,27 +67,27 @@
67 67
  * Global Leveling:
68 68
  *  219            z_fade_height                    (float)
69 69
  *
70
- * Mesh bed leveling:                               43 bytes
70
+ * MESH_BED_LEVELING:                               43 bytes
71 71
  *  223  M420 S    from mbl.status                  (bool)
72 72
  *  224            mbl.z_offset                     (float)
73 73
  *  228            GRID_MAX_POINTS_X                (uint8_t)
74 74
  *  229            GRID_MAX_POINTS_Y                (uint8_t)
75 75
  *  230 G29 S3 XYZ z_values[][]                     (float x9, up to float x 81) +288
76 76
  *
77
- * AUTO BED LEVELING                                4 bytes
77
+ * HAS_BED_PROBE:                                   4 bytes
78 78
  *  266  M851      zprobe_zoffset                   (float)
79 79
  *
80
- * ABL_PLANAR (or placeholder):                     36 bytes
80
+ * ABL_PLANAR:                                      36 bytes
81 81
  *  270            planner.bed_level_matrix         (matrix_3x3 = float x9)
82 82
  *
83
- * AUTO_BED_LEVELING_BILINEAR (or placeholder):     47 bytes
83
+ * AUTO_BED_LEVELING_BILINEAR:                      47 bytes
84 84
  *  306            GRID_MAX_POINTS_X                (uint8_t)
85 85
  *  307            GRID_MAX_POINTS_Y                (uint8_t)
86 86
  *  308            bilinear_grid_spacing            (int x2)
87 87
  *  312  G29 L F   bilinear_start                   (int x2)
88 88
  *  316            bed_level_grid[][]               (float x9, up to float x256) +988
89 89
  *
90
- * DELTA (if deltabot):                             48 bytes
90
+ * DELTA:                                           48 bytes
91 91
  *  348  M666 XYZ  endstop_adj                      (float x3)
92 92
  *  360  M665 R    delta_radius                     (float)
93 93
  *  364  M665 L    delta_diagonal_rod               (float)
@@ -99,7 +99,7 @@
99 99
  *  388  M665 J    delta_tower_angle_trim[B]        (float)
100 100
  *  392  M665 K    delta_tower_angle_trim[C]        (float)
101 101
  *
102
- * Z_DUAL_ENDSTOPS (if not deltabot):               48 bytes
102
+ * Z_DUAL_ENDSTOPS:                                 48 bytes
103 103
  *  348  M666 Z    z_endstop_adj                    (float)
104 104
  *  ---            dummy data                       (float x11)
105 105
  *
@@ -136,7 +136,7 @@
136 136
  *  533  M200 D    volumetric_enabled               (bool)
137 137
  *  534  M200 T D  filament_size                    (float x5) (T0..3)
138 138
  *
139
- * TMC2130 Stepper Current:                         20 bytes
139
+ * HAVE_TMC2130:                                    20 bytes
140 140
  *  554  M906 X    stepperX current                 (uint16_t)
141 141
  *  556  M906 Y    stepperY current                 (uint16_t)
142 142
  *  558  M906 Z    stepperZ current                 (uint16_t)
@@ -149,8 +149,12 @@
149 149
  *  572  M906 E3   stepperE3 current                (uint16_t)
150 150
  *  576  M906 E4   stepperE4 current                (uint16_t)
151 151
  *
152
- *  580                                Minimum end-point
153
- * 1901 (580 + 36 + 9 + 288 + 988)     Maximum end-point
152
+ * LIN_ADVANCE:                                     8 bytes
153
+ *  580  M900 K    extruder_advance_k               (float)
154
+ *  584  M900 WHD  advance_ed_ratio                 (float)
155
+ *
156
+ *  588                                Minimum end-point
157
+ * 1909 (588 + 36 + 9 + 288 + 988)     Maximum end-point
154 158
  */
155 159
 #include "configuration_store.h"
156 160
 
@@ -570,6 +574,20 @@ void MarlinSettings::postprocess() {
570 574
       for (uint8_t q = 0; q < 11; ++q) EEPROM_WRITE(val);
571 575
     #endif
572 576
 
577
+    //
578
+    // Linear Advance
579
+    //
580
+
581
+    float extruder_advance_k = 0.0f, advance_ed_ratio = 0.0f;
582
+
583
+    #if ENABLED(LIN_ADVANCE)
584
+      extruder_advance_k = planner.get_extruder_advance_k();
585
+      advance_ed_ratio = planner.get_advance_ed_ratio();
586
+    #endif
587
+
588
+    EEPROM_WRITE(extruder_advance_k);
589
+    EEPROM_WRITE(advance_ed_ratio);
590
+
573 591
     if (!eeprom_write_error) {
574 592
 
575 593
       const uint16_t final_checksum = eeprom_checksum,
@@ -900,6 +918,19 @@ void MarlinSettings::postprocess() {
900 918
         for (uint8_t q = 0; q < 11; q++) EEPROM_READ(val);
901 919
       #endif
902 920
 
921
+      //
922
+      // Linear Advance
923
+      //
924
+
925
+      float extruder_advance_k, advance_ed_ratio;
926
+      EEPROM_READ(extruder_advance_k);
927
+      EEPROM_READ(advance_ed_ratio);
928
+
929
+      #if ENABLED(LIN_ADVANCE)
930
+        planner.set_extruder_advance_k(extruder_advance_k);
931
+        planner.set_advance_ed_ratio(advance_ed_ratio);
932
+      #endif
933
+
903 934
       if (eeprom_checksum == stored_checksum) {
904 935
         if (eeprom_read_error)
905 936
           reset();
@@ -1155,6 +1186,11 @@ void MarlinSettings::reset() {
1155 1186
     #endif
1156 1187
   #endif
1157 1188
 
1189
+  #if ENABLED(LIN_ADVANCE)
1190
+    planner.set_extruder_advance_k(LIN_ADVANCE_K);
1191
+    planner.set_advance_ed_ratio(LIN_ADVANCE_E_D_RATIO);
1192
+  #endif
1193
+
1158 1194
   postprocess();
1159 1195
 
1160 1196
   SERIAL_ECHO_START;
@@ -1165,6 +1201,13 @@ void MarlinSettings::reset() {
1165 1201
 
1166 1202
   #define CONFIG_ECHO_START do{ if (!forReplay) SERIAL_ECHO_START; }while(0)
1167 1203
 
1204
+  #if ENABLED(INCH_MODE_SUPPORT)
1205
+    extern float linear_unit_factor;
1206
+    #define LINEAR_UNIT(N) ((N) / linear_unit_factor)
1207
+  #else
1208
+    #define LINEAR_UNIT(N) N
1209
+  #endif
1210
+
1168 1211
   /**
1169 1212
    * M503 - Report current settings in RAM
1170 1213
    *
@@ -1172,113 +1215,168 @@ void MarlinSettings::reset() {
1172 1215
    */
1173 1216
   void MarlinSettings::report(bool forReplay) {
1174 1217
 
1218
+    /**
1219
+     * Announce current units, in case inches are being displayed
1220
+     */
1175 1221
     CONFIG_ECHO_START;
1222
+    #if ENABLED(INCH_MODE_SUPPORT)
1223
+      extern float linear_unit_factor, volumetric_unit_factor;
1224
+      #define LINEAR_UNIT(N) ((N) / linear_unit_factor)
1225
+      #define VOLUMETRIC_UNIT(N) ((N) / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor))
1226
+      serialprintPGM(linear_unit_factor == 1.0 ? PSTR("  G21 ; Units in mm\n") : PSTR("  G20 ; Units in inches\n"));
1227
+    #else
1228
+      #define LINEAR_UNIT(N) N
1229
+      #define VOLUMETRIC_UNIT(N) N
1230
+      SERIAL_ECHOLNPGM("  G21 ; Units in mm\n");
1231
+    #endif
1232
+    SERIAL_EOL;
1176 1233
 
1234
+    /**
1235
+     * Volumetric extrusion M200
1236
+     */
1177 1237
     if (!forReplay) {
1178
-      SERIAL_ECHOLNPGM("Steps per unit:");
1179 1238
       CONFIG_ECHO_START;
1239
+      SERIAL_ECHOPGM("Filament settings:");
1240
+      if (volumetric_enabled)
1241
+        SERIAL_EOL;
1242
+      else
1243
+        SERIAL_ECHOLNPGM(" Disabled");
1180 1244
     }
1181
-    SERIAL_ECHOPAIR("  M92 X", planner.axis_steps_per_mm[X_AXIS]);
1182
-    SERIAL_ECHOPAIR(" Y", planner.axis_steps_per_mm[Y_AXIS]);
1183
-    SERIAL_ECHOPAIR(" Z", planner.axis_steps_per_mm[Z_AXIS]);
1245
+
1246
+    CONFIG_ECHO_START;
1247
+    SERIAL_ECHOPAIR("  M200 D", filament_size[0]);
1248
+    SERIAL_EOL;
1249
+    #if EXTRUDERS > 1
1250
+      CONFIG_ECHO_START;
1251
+      SERIAL_ECHOPAIR("  M200 T1 D", filament_size[1]);
1252
+      SERIAL_EOL;
1253
+      #if EXTRUDERS > 2
1254
+        CONFIG_ECHO_START;
1255
+        SERIAL_ECHOPAIR("  M200 T2 D", filament_size[2]);
1256
+        SERIAL_EOL;
1257
+        #if EXTRUDERS > 3
1258
+          CONFIG_ECHO_START;
1259
+          SERIAL_ECHOPAIR("  M200 T3 D", filament_size[3]);
1260
+          SERIAL_EOL;
1261
+          #if EXTRUDERS > 4
1262
+            CONFIG_ECHO_START;
1263
+            SERIAL_ECHOPAIR("  M200 T4 D", filament_size[4]);
1264
+            SERIAL_EOL;
1265
+          #endif // EXTRUDERS > 4
1266
+        #endif // EXTRUDERS > 3
1267
+      #endif // EXTRUDERS > 2
1268
+    #endif // EXTRUDERS > 1
1269
+
1270
+    if (!volumetric_enabled) {
1271
+      CONFIG_ECHO_START;
1272
+      SERIAL_ECHOLNPGM("  M200 D0");
1273
+    }
1274
+
1275
+    if (!forReplay) {
1276
+      CONFIG_ECHO_START;
1277
+      SERIAL_ECHOLNPGM("Steps per unit:");
1278
+    }
1279
+    CONFIG_ECHO_START;
1280
+    SERIAL_ECHOPAIR("  M92 X", LINEAR_UNIT(planner.axis_steps_per_mm[X_AXIS]));
1281
+    SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.axis_steps_per_mm[Y_AXIS]));
1282
+    SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.axis_steps_per_mm[Z_AXIS]));
1184 1283
     #if DISABLED(DISTINCT_E_FACTORS)
1185
-      SERIAL_ECHOPAIR(" E", planner.axis_steps_per_mm[E_AXIS]);
1284
+      SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS]));
1186 1285
     #endif
1187 1286
     SERIAL_EOL;
1188 1287
     #if ENABLED(DISTINCT_E_FACTORS)
1288
+      CONFIG_ECHO_START;
1189 1289
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
1190 1290
         SERIAL_ECHOPAIR("  M92 T", (int)i);
1191
-        SERIAL_ECHOLNPAIR(" E", planner.axis_steps_per_mm[E_AXIS + i]);
1291
+        SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.axis_steps_per_mm[E_AXIS + i]));
1192 1292
       }
1193 1293
     #endif
1194 1294
 
1195
-    CONFIG_ECHO_START;
1196
-
1197 1295
     if (!forReplay) {
1198
-      SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
1199 1296
       CONFIG_ECHO_START;
1297
+      SERIAL_ECHOLNPGM("Maximum feedrates (units/s):");
1200 1298
     }
1201
-    SERIAL_ECHOPAIR("  M203 X", planner.max_feedrate_mm_s[X_AXIS]);
1202
-    SERIAL_ECHOPAIR(" Y", planner.max_feedrate_mm_s[Y_AXIS]);
1203
-    SERIAL_ECHOPAIR(" Z", planner.max_feedrate_mm_s[Z_AXIS]);
1299
+    CONFIG_ECHO_START;
1300
+    SERIAL_ECHOPAIR("  M203 X", LINEAR_UNIT(planner.max_feedrate_mm_s[X_AXIS]));
1301
+    SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_feedrate_mm_s[Y_AXIS]));
1302
+    SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_feedrate_mm_s[Z_AXIS]));
1204 1303
     #if DISABLED(DISTINCT_E_FACTORS)
1205
-      SERIAL_ECHOPAIR(" E", planner.max_feedrate_mm_s[E_AXIS]);
1304
+      SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS]));
1206 1305
     #endif
1207 1306
     SERIAL_EOL;
1208 1307
     #if ENABLED(DISTINCT_E_FACTORS)
1308
+      CONFIG_ECHO_START;
1209 1309
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
1210 1310
         SERIAL_ECHOPAIR("  M203 T", (int)i);
1211
-        SERIAL_ECHOLNPAIR(" E", planner.max_feedrate_mm_s[E_AXIS + i]);
1311
+        SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_feedrate_mm_s[E_AXIS + i]));
1212 1312
       }
1213 1313
     #endif
1214 1314
 
1215
-    CONFIG_ECHO_START;
1216 1315
     if (!forReplay) {
1217
-      SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
1218 1316
       CONFIG_ECHO_START;
1317
+      SERIAL_ECHOLNPGM("Maximum Acceleration (units/s2):");
1219 1318
     }
1220
-    SERIAL_ECHOPAIR("  M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]);
1221
-    SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]);
1222
-    SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]);
1319
+    CONFIG_ECHO_START;
1320
+    SERIAL_ECHOPAIR("  M201 X", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[X_AXIS]));
1321
+    SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Y_AXIS]));
1322
+    SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_acceleration_mm_per_s2[Z_AXIS]));
1223 1323
     #if DISABLED(DISTINCT_E_FACTORS)
1224
-      SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
1324
+      SERIAL_ECHOPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS]));
1225 1325
     #endif
1226 1326
     SERIAL_EOL;
1227 1327
     #if ENABLED(DISTINCT_E_FACTORS)
1328
+      SERIAL_ECHO_START;
1228 1329
       for (uint8_t i = 0; i < E_STEPPERS; i++) {
1229 1330
         SERIAL_ECHOPAIR("  M201 T", (int)i);
1230
-        SERIAL_ECHOLNPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS + i]);
1331
+        SERIAL_ECHOLNPAIR(" E", VOLUMETRIC_UNIT(planner.max_acceleration_mm_per_s2[E_AXIS + i]));
1231 1332
       }
1232 1333
     #endif
1233 1334
 
1234
-    CONFIG_ECHO_START;
1235 1335
     if (!forReplay) {
1236
-      SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");
1237 1336
       CONFIG_ECHO_START;
1337
+      SERIAL_ECHOLNPGM("Acceleration (units/s2): P<print_accel> R<retract_accel> T<travel_accel>");
1238 1338
     }
1239
-    SERIAL_ECHOPAIR("  M204 P", planner.acceleration);
1240
-    SERIAL_ECHOPAIR(" R", planner.retract_acceleration);
1241
-    SERIAL_ECHOPAIR(" T", planner.travel_acceleration);
1242
-    SERIAL_EOL;
1243
-
1244 1339
     CONFIG_ECHO_START;
1340
+    SERIAL_ECHOPAIR("  M204 P", LINEAR_UNIT(planner.acceleration));
1341
+    SERIAL_ECHOPAIR(" R", LINEAR_UNIT(planner.retract_acceleration));
1342
+    SERIAL_ECHOLNPAIR(" T", LINEAR_UNIT(planner.travel_acceleration));
1343
+
1245 1344
     if (!forReplay) {
1246
-      SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)");
1247 1345
       CONFIG_ECHO_START;
1346
+      SERIAL_ECHOLNPGM("Advanced: S<min_feedrate> T<min_travel_feedrate> B<min_segment_time_ms> X<max_xy_jerk> Z<max_z_jerk> E<max_e_jerk>");
1248 1347
     }
1249
-    SERIAL_ECHOPAIR("  M205 S", planner.min_feedrate_mm_s);
1250
-    SERIAL_ECHOPAIR(" T", planner.min_travel_feedrate_mm_s);
1348
+    CONFIG_ECHO_START;
1349
+    SERIAL_ECHOPAIR("  M205 S", LINEAR_UNIT(planner.min_feedrate_mm_s));
1350
+    SERIAL_ECHOPAIR(" T", LINEAR_UNIT(planner.min_travel_feedrate_mm_s));
1251 1351
     SERIAL_ECHOPAIR(" B", planner.min_segment_time);
1252
-    SERIAL_ECHOPAIR(" X", planner.max_jerk[X_AXIS]);
1253
-    SERIAL_ECHOPAIR(" Y", planner.max_jerk[Y_AXIS]);
1254
-    SERIAL_ECHOPAIR(" Z", planner.max_jerk[Z_AXIS]);
1255
-    SERIAL_ECHOPAIR(" E", planner.max_jerk[E_AXIS]);
1256
-    SERIAL_EOL;
1352
+    SERIAL_ECHOPAIR(" X", LINEAR_UNIT(planner.max_jerk[X_AXIS]));
1353
+    SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(planner.max_jerk[Y_AXIS]));
1354
+    SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.max_jerk[Z_AXIS]));
1355
+    SERIAL_ECHOLNPAIR(" E", LINEAR_UNIT(planner.max_jerk[E_AXIS]));
1257 1356
 
1258 1357
     #if HAS_M206_COMMAND
1259
-      CONFIG_ECHO_START;
1260 1358
       if (!forReplay) {
1261
-        SERIAL_ECHOLNPGM("Home offset (mm)");
1262 1359
         CONFIG_ECHO_START;
1360
+        SERIAL_ECHOLNPGM("Home offset:");
1263 1361
       }
1264
-      SERIAL_ECHOPAIR("  M206 X", home_offset[X_AXIS]);
1265
-      SERIAL_ECHOPAIR(" Y", home_offset[Y_AXIS]);
1266
-      SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS]);
1267
-      SERIAL_EOL;
1362
+      CONFIG_ECHO_START;
1363
+      SERIAL_ECHOPAIR("  M206 X", LINEAR_UNIT(home_offset[X_AXIS]));
1364
+      SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(home_offset[Y_AXIS]));
1365
+      SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(home_offset[Z_AXIS]));
1268 1366
     #endif
1269 1367
 
1270 1368
     #if HOTENDS > 1
1271
-      CONFIG_ECHO_START;
1272 1369
       if (!forReplay) {
1273
-        SERIAL_ECHOLNPGM("Hotend offsets (mm)");
1274 1370
         CONFIG_ECHO_START;
1371
+        SERIAL_ECHOLNPGM("Hotend offsets:");
1275 1372
       }
1373
+      CONFIG_ECHO_START;
1276 1374
       for (uint8_t e = 1; e < HOTENDS; e++) {
1277 1375
         SERIAL_ECHOPAIR("  M218 T", (int)e);
1278
-        SERIAL_ECHOPAIR(" X", hotend_offset[X_AXIS][e]);
1279
-        SERIAL_ECHOPAIR(" Y", hotend_offset[Y_AXIS][e]);
1376
+        SERIAL_ECHOPAIR(" X", LINEAR_UNIT(hotend_offset[X_AXIS][e]));
1377
+        SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e]));
1280 1378
         #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_EXTRUDER)
1281
-          SERIAL_ECHOPAIR(" Z", hotend_offset[Z_AXIS][e]);
1379
+          SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e]));
1282 1380
         #endif
1283 1381
         SERIAL_EOL;
1284 1382
       }
@@ -1287,12 +1385,13 @@ void MarlinSettings::reset() {
1287 1385
     #if ENABLED(MESH_BED_LEVELING)
1288 1386
 
1289 1387
       if (!forReplay) {
1290
-        SERIAL_ECHOLNPGM("Mesh Bed Leveling:");
1291 1388
         CONFIG_ECHO_START;
1389
+        SERIAL_ECHOLNPGM("Mesh Bed Leveling:");
1292 1390
       }
1391
+      CONFIG_ECHO_START;
1293 1392
       SERIAL_ECHOPAIR("  M420 S", mbl.has_mesh() ? 1 : 0);
1294 1393
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1295
-        SERIAL_ECHOLNPAIR(" Z", planner.z_fade_height);
1394
+        SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.z_fade_height));
1296 1395
       #endif
1297 1396
       SERIAL_EOL;
1298 1397
       for (uint8_t py = 0; py < GRID_MAX_POINTS_Y; py++) {
@@ -1301,7 +1400,7 @@ void MarlinSettings::reset() {
1301 1400
           SERIAL_ECHOPAIR("  G29 S3 X", (int)px + 1);
1302 1401
           SERIAL_ECHOPAIR(" Y", (int)py + 1);
1303 1402
           SERIAL_ECHOPGM(" Z");
1304
-          SERIAL_PROTOCOL_F(mbl.z_values[px][py], 5);
1403
+          SERIAL_PROTOCOL_F(LINEAR_UNIT(mbl.z_values[px][py]), 5);
1305 1404
           SERIAL_EOL;
1306 1405
         }
1307 1406
       }
@@ -1309,12 +1408,13 @@ void MarlinSettings::reset() {
1309 1408
     #elif ENABLED(AUTO_BED_LEVELING_UBL)
1310 1409
 
1311 1410
       if (!forReplay) {
1312
-        SERIAL_ECHOLNPGM("Unified Bed Leveling:");
1313 1411
         CONFIG_ECHO_START;
1412
+        SERIAL_ECHOLNPGM("Unified Bed Leveling:");
1314 1413
       }
1414
+      CONFIG_ECHO_START;
1315 1415
       SERIAL_ECHOPAIR("  M420 S", ubl.state.active ? 1 : 0);
1316 1416
       //#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1317
-      //  SERIAL_ECHOLNPAIR(" Z", ubl.state.g29_correction_fade_height);
1417
+      //  SERIAL_ECHOPAIR(" Z", ubl.state.g29_correction_fade_height);
1318 1418
       //#endif
1319 1419
       SERIAL_EOL;
1320 1420
 
@@ -1351,72 +1451,69 @@ void MarlinSettings::reset() {
1351 1451
     #elif HAS_ABL
1352 1452
 
1353 1453
       if (!forReplay) {
1354
-        SERIAL_ECHOLNPGM("Auto Bed Leveling:");
1355 1454
         CONFIG_ECHO_START;
1455
+        SERIAL_ECHOLNPGM("Auto Bed Leveling:");
1356 1456
       }
1457
+      CONFIG_ECHO_START;
1357 1458
       SERIAL_ECHOPAIR("  M420 S", planner.abl_enabled ? 1 : 0);
1358 1459
       #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1359
-        SERIAL_ECHOLNPAIR(" Z", planner.z_fade_height);
1460
+        SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(planner.z_fade_height));
1360 1461
       #endif
1361 1462
       SERIAL_EOL;
1362 1463
 
1363 1464
     #endif
1364 1465
 
1365 1466
     #if ENABLED(DELTA)
1366
-      CONFIG_ECHO_START;
1367 1467
       if (!forReplay) {
1368
-        SERIAL_ECHOLNPGM("Endstop adjustment (mm):");
1369 1468
         CONFIG_ECHO_START;
1469
+        SERIAL_ECHOLNPGM("Endstop adjustment:");
1370 1470
       }
1371
-      SERIAL_ECHOPAIR("  M666 X", endstop_adj[X_AXIS]);
1372
-      SERIAL_ECHOPAIR(" Y", endstop_adj[Y_AXIS]);
1373
-      SERIAL_ECHOPAIR(" Z", endstop_adj[Z_AXIS]);
1374
-      SERIAL_EOL;
1375 1471
       CONFIG_ECHO_START;
1472
+      SERIAL_ECHOPAIR("  M666 X", LINEAR_UNIT(endstop_adj[X_AXIS]));
1473
+      SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(endstop_adj[Y_AXIS]));
1474
+      SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(endstop_adj[Z_AXIS]));
1376 1475
       if (!forReplay) {
1377
-        SERIAL_ECHOLNPGM("Delta settings: L=diagonal_rod, R=radius, H=height, S=segments_per_second, ABC=diagonal_rod_trim_tower_[123]");
1378 1476
         CONFIG_ECHO_START;
1477
+        SERIAL_ECHOLNPGM("Delta settings: L<diagonal_rod> R<radius> H<height> S<segments_per_s> ABC<diagonal_rod_[123]_trim>");
1379 1478
       }
1380
-      SERIAL_ECHOPAIR("  M665 L", delta_diagonal_rod);
1381
-      SERIAL_ECHOPAIR(" R", delta_radius);
1382
-      SERIAL_ECHOPAIR(" H", DELTA_HEIGHT + home_offset[Z_AXIS]);
1479
+      CONFIG_ECHO_START;
1480
+      SERIAL_ECHOPAIR("  M665 L", LINEAR_UNIT(delta_diagonal_rod));
1481
+      SERIAL_ECHOPAIR(" R", LINEAR_UNIT(delta_radius));
1482
+      SERIAL_ECHOPAIR(" H", LINEAR_UNIT(DELTA_HEIGHT + home_offset[Z_AXIS]));
1383 1483
       SERIAL_ECHOPAIR(" S", delta_segments_per_second);
1384
-      SERIAL_ECHOPAIR(" A", delta_diagonal_rod_trim[A_AXIS]);
1385
-      SERIAL_ECHOPAIR(" B", delta_diagonal_rod_trim[B_AXIS]);
1386
-      SERIAL_ECHOPAIR(" C", delta_diagonal_rod_trim[C_AXIS]);
1387
-      SERIAL_ECHOPAIR(" I", delta_tower_angle_trim[A_AXIS]);
1388
-      SERIAL_ECHOPAIR(" J", delta_tower_angle_trim[B_AXIS]);
1389
-      SERIAL_ECHOPAIR(" K", delta_tower_angle_trim[C_AXIS]);
1390
-      SERIAL_EOL;
1484
+      SERIAL_ECHOPAIR(" A", LINEAR_UNIT(delta_diagonal_rod_trim[A_AXIS]));
1485
+      SERIAL_ECHOPAIR(" B", LINEAR_UNIT(delta_diagonal_rod_trim[B_AXIS]));
1486
+      SERIAL_ECHOPAIR(" C", LINEAR_UNIT(delta_diagonal_rod_trim[C_AXIS]));
1487
+      SERIAL_ECHOPAIR(" I", LINEAR_UNIT(delta_tower_angle_trim[A_AXIS]));
1488
+      SERIAL_ECHOPAIR(" J", LINEAR_UNIT(delta_tower_angle_trim[B_AXIS]));
1489
+      SERIAL_ECHOLNPAIR(" K", LINEAR_UNIT(delta_tower_angle_trim[C_AXIS]));
1391 1490
     #elif ENABLED(Z_DUAL_ENDSTOPS)
1392
-      CONFIG_ECHO_START;
1393 1491
       if (!forReplay) {
1394
-        SERIAL_ECHOLNPGM("Z2 Endstop adjustment (mm):");
1395 1492
         CONFIG_ECHO_START;
1493
+        SERIAL_ECHOLNPGM("Z2 Endstop adjustment:");
1396 1494
       }
1397
-      SERIAL_ECHOPAIR("  M666 Z", z_endstop_adj);
1398
-      SERIAL_EOL;
1495
+      CONFIG_ECHO_START;
1496
+      SERIAL_ECHOLNPAIR("  M666 Z", LINEAR_UNIT(z_endstop_adj));
1399 1497
     #endif // DELTA
1400 1498
 
1401 1499
     #if ENABLED(ULTIPANEL)
1402
-      CONFIG_ECHO_START;
1403 1500
       if (!forReplay) {
1404
-        SERIAL_ECHOLNPGM("Material heatup parameters:");
1405 1501
         CONFIG_ECHO_START;
1502
+        SERIAL_ECHOLNPGM("Material heatup parameters:");
1406 1503
       }
1504
+      CONFIG_ECHO_START;
1407 1505
       for (uint8_t i = 0; i < COUNT(lcd_preheat_hotend_temp); i++) {
1408 1506
         SERIAL_ECHOPAIR("  M145 S", (int)i);
1409 1507
         SERIAL_ECHOPAIR(" H", lcd_preheat_hotend_temp[i]);
1410 1508
         SERIAL_ECHOPAIR(" B", lcd_preheat_bed_temp[i]);
1411
-        SERIAL_ECHOPAIR(" F", lcd_preheat_fan_speed[i]);
1412
-        SERIAL_EOL;
1509
+        SERIAL_ECHOLNPAIR(" F", lcd_preheat_fan_speed[i]);
1413 1510
       }
1414 1511
     #endif // ULTIPANEL
1415 1512
 
1416 1513
     #if HAS_PID_HEATING
1417 1514
 
1418
-      CONFIG_ECHO_START;
1419 1515
       if (!forReplay) {
1516
+        CONFIG_ECHO_START;
1420 1517
         SERIAL_ECHOLNPGM("PID settings:");
1421 1518
       }
1422 1519
       #if ENABLED(PIDTEMP)
@@ -1462,113 +1559,69 @@ void MarlinSettings::reset() {
1462 1559
     #endif // PIDTEMP || PIDTEMPBED
1463 1560
 
1464 1561
     #if HAS_LCD_CONTRAST
1465
-      CONFIG_ECHO_START;
1466 1562
       if (!forReplay) {
1467
-        SERIAL_ECHOLNPGM("LCD Contrast:");
1468 1563
         CONFIG_ECHO_START;
1564
+        SERIAL_ECHOLNPGM("LCD Contrast:");
1469 1565
       }
1470
-      SERIAL_ECHOPAIR("  M250 C", lcd_contrast);
1471
-      SERIAL_EOL;
1566
+      CONFIG_ECHO_START;
1567
+      SERIAL_ECHOLNPAIR("  M250 C", lcd_contrast);
1472 1568
     #endif
1473 1569
 
1474 1570
     #if ENABLED(FWRETRACT)
1475 1571
 
1476
-      CONFIG_ECHO_START;
1477 1572
       if (!forReplay) {
1478
-        SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
1479 1573
         CONFIG_ECHO_START;
1574
+        SERIAL_ECHOLNPGM("Retract: S<length> F<units/m> Z<lift>");
1480 1575
       }
1481
-      SERIAL_ECHOPAIR("  M207 S", retract_length);
1576
+      CONFIG_ECHO_START;
1577
+      SERIAL_ECHOPAIR("  M207 S", LINEAR_UNIT(retract_length));
1482 1578
       #if EXTRUDERS > 1
1483
-        SERIAL_ECHOPAIR(" W", retract_length_swap);
1579
+        SERIAL_ECHOPAIR(" W", LINEAR_UNIT(retract_length_swap));
1484 1580
       #endif
1485
-      SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_feedrate_mm_s));
1486
-      SERIAL_ECHOPAIR(" Z", retract_zlift);
1487
-      SERIAL_EOL;
1488
-      CONFIG_ECHO_START;
1581
+      SERIAL_ECHOPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(retract_feedrate_mm_s)));
1582
+      SERIAL_ECHOLNPAIR(" Z", LINEAR_UNIT(retract_zlift));
1583
+
1489 1584
       if (!forReplay) {
1490
-        SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
1491 1585
         CONFIG_ECHO_START;
1586
+        SERIAL_ECHOLNPGM("Recover: S<length> F<units/m>");
1492 1587
       }
1493
-      SERIAL_ECHOPAIR("  M208 S", retract_recover_length);
1588
+      CONFIG_ECHO_START;
1589
+      SERIAL_ECHOPAIR("  M208 S", LINEAR_UNIT(retract_recover_length));
1494 1590
       #if EXTRUDERS > 1
1495
-        SERIAL_ECHOPAIR(" W", retract_recover_length_swap);
1591
+        SERIAL_ECHOPAIR(" W", LINEAR_UNIT(retract_recover_length_swap));
1496 1592
       #endif
1497
-      SERIAL_ECHOPAIR(" F", MMS_TO_MMM(retract_recover_feedrate_mm_s));
1498
-      SERIAL_EOL;
1499
-      CONFIG_ECHO_START;
1593
+      SERIAL_ECHOLNPAIR(" F", MMS_TO_MMM(LINEAR_UNIT(retract_recover_feedrate_mm_s)));
1594
+
1500 1595
       if (!forReplay) {
1501
-        SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
1502 1596
         CONFIG_ECHO_START;
1597
+        SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
1503 1598
       }
1504
-      SERIAL_ECHOPAIR("  M209 S", autoretract_enabled ? 1 : 0);
1505
-      SERIAL_EOL;
1506
-
1507
-    #endif // FWRETRACT
1508
-
1509
-    /**
1510
-     * Volumetric extrusion M200
1511
-     */
1512
-    if (!forReplay) {
1513
-      CONFIG_ECHO_START;
1514
-      SERIAL_ECHOPGM("Filament settings:");
1515
-      if (volumetric_enabled)
1516
-        SERIAL_EOL;
1517
-      else
1518
-        SERIAL_ECHOLNPGM(" Disabled");
1519
-    }
1520
-
1521
-    CONFIG_ECHO_START;
1522
-    SERIAL_ECHOPAIR("  M200 D", filament_size[0]);
1523
-    SERIAL_EOL;
1524
-    #if EXTRUDERS > 1
1525 1599
       CONFIG_ECHO_START;
1526
-      SERIAL_ECHOPAIR("  M200 T1 D", filament_size[1]);
1527
-      SERIAL_EOL;
1528
-      #if EXTRUDERS > 2
1529
-        CONFIG_ECHO_START;
1530
-        SERIAL_ECHOPAIR("  M200 T2 D", filament_size[2]);
1531
-        SERIAL_EOL;
1532
-        #if EXTRUDERS > 3
1533
-          CONFIG_ECHO_START;
1534
-          SERIAL_ECHOPAIR("  M200 T3 D", filament_size[3]);
1535
-          SERIAL_EOL;
1536
-          #if EXTRUDERS > 4
1537
-            CONFIG_ECHO_START;
1538
-            SERIAL_ECHOPAIR("  M200 T4 D", filament_size[4]);
1539
-            SERIAL_EOL;
1540
-          #endif // EXTRUDERS > 4
1541
-        #endif // EXTRUDERS > 3
1542
-      #endif // EXTRUDERS > 2
1543
-    #endif // EXTRUDERS > 1
1600
+      SERIAL_ECHOLNPAIR("  M209 S", autoretract_enabled ? 1 : 0);
1544 1601
 
1545
-    if (!volumetric_enabled) {
1546
-      CONFIG_ECHO_START;
1547
-      SERIAL_ECHOLNPGM("  M200 D0");
1548
-    }
1602
+    #endif // FWRETRACT
1549 1603
 
1550 1604
     /**
1551 1605
      * Auto Bed Leveling
1552 1606
      */
1553 1607
     #if HAS_BED_PROBE
1554
-      CONFIG_ECHO_START;
1555 1608
       if (!forReplay) {
1556
-        SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
1557 1609
         CONFIG_ECHO_START;
1610
+        SERIAL_ECHOLNPGM("Z-Probe Offset (mm):");
1558 1611
       }
1559
-      SERIAL_ECHOPAIR("  M851 Z", zprobe_zoffset);
1560
-      SERIAL_EOL;
1612
+      CONFIG_ECHO_START;
1613
+      SERIAL_ECHOLNPAIR("  M851 Z", LINEAR_UNIT(zprobe_zoffset));
1561 1614
     #endif
1562 1615
 
1563 1616
     /**
1564 1617
      * TMC2130 stepper driver current
1565 1618
      */
1566 1619
     #if ENABLED(HAVE_TMC2130)
1567
-      CONFIG_ECHO_START;
1568 1620
       if (!forReplay) {
1569
-        SERIAL_ECHOLNPGM("Stepper driver current:");
1570 1621
         CONFIG_ECHO_START;
1622
+        SERIAL_ECHOLNPGM("Stepper driver current:");
1571 1623
       }
1624
+      CONFIG_ECHO_START;
1572 1625
       SERIAL_ECHO("  M906");
1573 1626
       #if ENABLED(X_IS_TMC2130)
1574 1627
         SERIAL_ECHOPAIR(" X", stepperX.getCurrent());
@@ -1602,6 +1655,19 @@ void MarlinSettings::reset() {
1602 1655
       #endif
1603 1656
       SERIAL_EOL;
1604 1657
     #endif
1658
+
1659
+    /**
1660
+     * Linear Advance
1661
+     */
1662
+    #if ENABLED(LIN_ADVANCE)
1663
+      if (!forReplay) {
1664
+        CONFIG_ECHO_START;
1665
+        SERIAL_ECHOLNPGM("Linear Advance:");
1666
+      }
1667
+      CONFIG_ECHO_START;
1668
+      SERIAL_ECHOPAIR("  M900 K", planner.get_extruder_advance_k());
1669
+      SERIAL_ECHOLNPAIR(" R", planner.get_advance_ed_ratio());
1670
+    #endif
1605 1671
   }
1606 1672
 
1607 1673
 #endif // !DISABLE_M503

+ 4
- 2
Marlin/example_configurations/Cartesio/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/Felix/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/Hephestos/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/Hephestos_2/Configuration_adv.h Dosyayı Görüntüle

@@ -614,13 +614,15 @@
614 614
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
615 615
    * if the slicer is using variable widths or layer heights within one print!
616 616
    *
617
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
617
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
618 618
    *
619
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
619
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
620 620
    *   - W is the extrusion width in mm
621 621
    *   - H is the layer height in mm
622 622
    *   - D is the filament diameter in mm
623 623
    *
624
+   * Example: `M900 R0.0458` to set the ratio directly.
625
+   *
624 626
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
625 627
    *
626 628
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/K8200/Configuration_adv.h Dosyayı Görüntüle

@@ -643,13 +643,15 @@
643 643
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
644 644
    * if the slicer is using variable widths or layer heights within one print!
645 645
    *
646
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
646
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
647 647
    *
648
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
648
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
649 649
    *   - W is the extrusion width in mm
650 650
    *   - H is the layer height in mm
651 651
    *   - D is the filament diameter in mm
652 652
    *
653
+   * Example: `M900 R0.0458` to set the ratio directly.
654
+   *
653 655
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
654 656
    *
655 657
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/K8400/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/RigidBot/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/SCARA/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/TAZ4/Configuration_adv.h Dosyayı Görüntüle

@@ -638,13 +638,15 @@
638 638
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
639 639
    * if the slicer is using variable widths or layer heights within one print!
640 640
    *
641
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
641
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
642 642
    *
643
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
643
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
644 644
    *   - W is the extrusion width in mm
645 645
    *   - H is the layer height in mm
646 646
    *   - D is the filament diameter in mm
647 647
    *
648
+   * Example: `M900 R0.0458` to set the ratio directly.
649
+   *
648 650
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
649 651
    *
650 652
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/TinyBoy2/Configuration_adv.h Dosyayı Görüntüle

@@ -633,13 +633,15 @@
633 633
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
634 634
    * if the slicer is using variable widths or layer heights within one print!
635 635
    *
636
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
636
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
637 637
    *
638
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
638
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
639 639
    *   - W is the extrusion width in mm
640 640
    *   - H is the layer height in mm
641 641
    *   - D is the filament diameter in mm
642 642
    *
643
+   * Example: `M900 R0.0458` to set the ratio directly.
644
+   *
643 645
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
644 646
    *
645 647
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/WITBOX/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h Dosyayı Görüntüle

@@ -654,13 +654,15 @@
654 654
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
655 655
    * if the slicer is using variable widths or layer heights within one print!
656 656
    *
657
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
657
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
658 658
    *
659
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
659
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
660 660
    *   - W is the extrusion width in mm
661 661
    *   - H is the layer height in mm
662 662
    *   - D is the filament diameter in mm
663 663
    *
664
+   * Example: `M900 R0.0458` to set the ratio directly.
665
+   *
664 666
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
665 667
    *
666 668
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h Dosyayı Görüntüle

@@ -654,13 +654,15 @@
654 654
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
655 655
    * if the slicer is using variable widths or layer heights within one print!
656 656
    *
657
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
657
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
658 658
    *
659
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
659
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
660 660
    *   - W is the extrusion width in mm
661 661
    *   - H is the layer height in mm
662 662
    *   - D is the filament diameter in mm
663 663
    *
664
+   * Example: `M900 R0.0458` to set the ratio directly.
665
+   *
664 666
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
665 667
    *
666 668
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/generic/Configuration_adv.h Dosyayı Görüntüle

@@ -651,13 +651,15 @@
651 651
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
652 652
    * if the slicer is using variable widths or layer heights within one print!
653 653
    *
654
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
654
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
655 655
    *
656
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
656
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
657 657
    *   - W is the extrusion width in mm
658 658
    *   - H is the layer height in mm
659 659
    *   - D is the filament diameter in mm
660 660
    *
661
+   * Example: `M900 R0.0458` to set the ratio directly.
662
+   *
661 663
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
662 664
    *
663 665
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Dosyayı Görüntüle

@@ -651,13 +651,15 @@
651 651
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
652 652
    * if the slicer is using variable widths or layer heights within one print!
653 653
    *
654
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
654
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
655 655
    *
656
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
656
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
657 657
    *   - W is the extrusion width in mm
658 658
    *   - H is the layer height in mm
659 659
    *   - D is the filament diameter in mm
660 660
    *
661
+   * Example: `M900 R0.0458` to set the ratio directly.
662
+   *
661 663
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
662 664
    *
663 665
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h Dosyayı Görüntüle

@@ -657,13 +657,15 @@
657 657
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
658 658
    * if the slicer is using variable widths or layer heights within one print!
659 659
    *
660
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
660
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
661 661
    *
662
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
662
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
663 663
    *   - W is the extrusion width in mm
664 664
    *   - H is the layer height in mm
665 665
    *   - D is the filament diameter in mm
666 666
    *
667
+   * Example: `M900 R0.0458` to set the ratio directly.
668
+   *
667 669
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
668 670
    *
669 671
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h Dosyayı Görüntüle

@@ -651,13 +651,15 @@
651 651
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
652 652
    * if the slicer is using variable widths or layer heights within one print!
653 653
    *
654
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
654
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
655 655
    *
656
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
656
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
657 657
    *   - W is the extrusion width in mm
658 658
    *   - H is the layer height in mm
659 659
    *   - D is the filament diameter in mm
660 660
    *
661
+   * Example: `M900 R0.0458` to set the ratio directly.
662
+   *
661 663
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
662 664
    *
663 665
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/makibox/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Dosyayı Görüntüle

@@ -630,13 +630,15 @@
630 630
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
631 631
    * if the slicer is using variable widths or layer heights within one print!
632 632
    *
633
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
633
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
634 634
    *
635
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
635
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
636 636
    *   - W is the extrusion width in mm
637 637
    *   - H is the layer height in mm
638 638
    *   - D is the filament diameter in mm
639 639
    *
640
+   * Example: `M900 R0.0458` to set the ratio directly.
641
+   *
640 642
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
641 643
    *
642 644
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 4
- 2
Marlin/example_configurations/wt150/Configuration_adv.h Dosyayı Görüntüle

@@ -633,13 +633,15 @@
633 633
    * to a fixed value. Note that using a fixed ratio will lead to wrong nozzle pressures
634 634
    * if the slicer is using variable widths or layer heights within one print!
635 635
    *
636
-   * This option sets the default E:D ratio at startup. Use `M905` to override this value.
636
+   * This option sets the default E:D ratio at startup. Use `M900` to override this value.
637 637
    *
638
-   * Example: `M905 W0.4 H0.2 D1.75`, where:
638
+   * Example: `M900 W0.4 H0.2 D1.75`, where:
639 639
    *   - W is the extrusion width in mm
640 640
    *   - H is the layer height in mm
641 641
    *   - D is the filament diameter in mm
642 642
    *
643
+   * Example: `M900 R0.0458` to set the ratio directly.
644
+   *
643 645
    * Set to 0 to auto-detect the ratio based on given Gcode G1 print moves.
644 646
    *
645 647
    * Slic3r (including Prusa Slic3r) produces Gcode compatible with the automatic mode.

+ 1
- 1
Marlin/language_an.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("E5 trangos/mm")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
117 117
 #define MSG_MOTION                          _UxGT("Movimiento")
118
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
118
+#define MSG_FILAMENT                        _UxGT("Filamento")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
121 121
 #define MSG_CONTRAST                        _UxGT("Contraste")

+ 1
- 1
Marlin/language_bg.h Dosyayı Görüntüle

@@ -116,7 +116,7 @@
116 116
 #define MSG_E5STEPS                         _UxGT("E5 стъпки/mm")
117 117
 #define MSG_TEMPERATURE                     _UxGT("Температура")
118 118
 #define MSG_MOTION                          _UxGT("Движение")
119
-#define MSG_VOLUMETRIC                      _UxGT("Нишка")
119
+#define MSG_FILAMENT                        _UxGT("Нишка")
120 120
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
121 121
 #define MSG_FILAMENT_DIAM                   _UxGT("Диам. нишка")
122 122
 #define MSG_CONTRAST                        _UxGT("LCD контраст")

+ 1
- 1
Marlin/language_ca.h Dosyayı Görüntüle

@@ -120,7 +120,7 @@
120 120
 #define MSG_E5STEPS                         _UxGT("E5passos/mm")
121 121
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
122 122
 #define MSG_MOTION                          _UxGT("Moviment")
123
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
123
+#define MSG_FILAMENT                        _UxGT("Filament")
124 124
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E en mm3")
125 125
 #define MSG_FILAMENT_DIAM                   _UxGT("Diam. Fil.")
126 126
 #define MSG_CONTRAST                        _UxGT("Contrast de LCD")

+ 1
- 1
Marlin/language_cn.h Dosyayı Görüntüle

@@ -108,7 +108,7 @@
108 108
 #define MSG_E5STEPS                         "E5steps/mm"
109 109
 #define MSG_TEMPERATURE                     "\xc9\xd2"
110 110
 #define MSG_MOTION                          "\xdf\xb2"
111
-#define MSG_VOLUMETRIC                      "Filament"
111
+#define MSG_FILAMENT                        "Filament"
112 112
 #define MSG_VOLUMETRIC_ENABLED              "E in mm3"
113 113
 #define MSG_FILAMENT_DIAM                   "Fil. Dia."
114 114
 #define MSG_CONTRAST                        "LCD contrast"

+ 1
- 1
Marlin/language_cz.h Dosyayı Görüntüle

@@ -119,7 +119,7 @@
119 119
 #define MSG_E5STEPS                         _UxGT("E5kroku/mm")
120 120
 #define MSG_TEMPERATURE                     _UxGT("Teplota")
121 121
 #define MSG_MOTION                          _UxGT("Pohyb")
122
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
122
+#define MSG_FILAMENT                        _UxGT("Filament")
123 123
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E na mm3")
124 124
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Prum.")
125 125
 #define MSG_CONTRAST                        _UxGT("Kontrast LCD")

+ 1
- 1
Marlin/language_da.h Dosyayı Görüntüle

@@ -117,7 +117,7 @@
117 117
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")
118 118
 #define MSG_TEMPERATURE                     _UxGT("Temperatur")
119 119
 #define MSG_MOTION                          _UxGT("Bevægelse")
120
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
120
+#define MSG_FILAMENT                        _UxGT("Filament")
121 121
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E i mm3")
122 122
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
123 123
 #define MSG_CONTRAST                        _UxGT("LCD kontrast")

+ 1
- 1
Marlin/language_de.h Dosyayı Görüntüle

@@ -121,7 +121,7 @@
121 121
 #define MSG_E5STEPS                         _UxGT("E5 Steps/mm")
122 122
 #define MSG_TEMPERATURE                     _UxGT("Temperatur")
123 123
 #define MSG_MOTION                          _UxGT("Bewegung")
124
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
124
+#define MSG_FILAMENT                        _UxGT("Filament")
125 125
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm³")
126 126
 #define MSG_FILAMENT_DIAM                   _UxGT("D Fil.")
127 127
 #define MSG_CONTRAST                        _UxGT("LCD Kontrast")

+ 1
- 1
Marlin/language_el-gr.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("Bήματα Ε5 ανά μμ")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Θερμοκρασία")
117 117
 #define MSG_MOTION                          _UxGT("Κίνηση")
118
-#define MSG_VOLUMETRIC                      _UxGT("Νήμα")
118
+#define MSG_FILAMENT                        _UxGT("Νήμα")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("Ε σε μμ3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Διάμετρος νήματος")
121 121
 #define MSG_CONTRAST                        _UxGT("Κοντράστ LCD")

+ 1
- 1
Marlin/language_el.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("Bήματα Ε5 ανά μμ")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Θερμοκρασία")
117 117
 #define MSG_MOTION                          _UxGT("Κίνηση")
118
-#define MSG_VOLUMETRIC                      _UxGT("Νήμα")
118
+#define MSG_FILAMENT                        _UxGT("Νήμα")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("Ε σε μμ3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Διάμετρος νήματος")
121 121
 #define MSG_CONTRAST                        _UxGT("Κοντράστ LCD")

+ 5
- 2
Marlin/language_en.h Dosyayı Görüntüle

@@ -300,8 +300,8 @@
300 300
 #ifndef MSG_MOTION
301 301
   #define MSG_MOTION                          _UxGT("Motion")
302 302
 #endif
303
-#ifndef MSG_VOLUMETRIC
304
-  #define MSG_VOLUMETRIC                      _UxGT("Filament")
303
+#ifndef MSG_FILAMENT
304
+  #define MSG_FILAMENT                        _UxGT("Filament")
305 305
 #endif
306 306
 #ifndef MSG_VOLUMETRIC_ENABLED
307 307
   #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
@@ -309,6 +309,9 @@
309 309
 #ifndef MSG_FILAMENT_DIAM
310 310
   #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
311 311
 #endif
312
+#ifndef MSG_ADVANCE_K
313
+  #define MSG_ADVANCE_K                       _UxGT("Advance K")
314
+#endif
312 315
 #ifndef MSG_CONTRAST
313 316
   #define MSG_CONTRAST                        _UxGT("LCD contrast")
314 317
 #endif

+ 1
- 1
Marlin/language_es.h Dosyayı Görüntüle

@@ -119,7 +119,7 @@
119 119
 #define MSG_E5STEPS                         _UxGT("E5 pasos/mm")
120 120
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
121 121
 #define MSG_MOTION                          _UxGT("Movimiento")
122
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
122
+#define MSG_FILAMENT                        _UxGT("Filamento")
123 123
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
124 124
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
125 125
 #define MSG_CONTRAST                        _UxGT("Contraste")

+ 1
- 1
Marlin/language_eu.h Dosyayı Görüntüle

@@ -106,7 +106,7 @@
106 106
 #define MSG_E5STEPS                         _UxGT("E5 pausoak/mm")
107 107
 #define MSG_TEMPERATURE                     _UxGT("Tenperatura")
108 108
 #define MSG_MOTION                          _UxGT("Mugimendua")
109
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
109
+#define MSG_FILAMENT                        _UxGT("Filament")
110 110
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
111 111
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
112 112
 #define MSG_CONTRAST                        _UxGT("LCD kontrastea")

+ 1
- 1
Marlin/language_fi.h Dosyayı Görüntüle

@@ -107,7 +107,7 @@
107 107
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")
108 108
 #define MSG_TEMPERATURE                     _UxGT("Lämpötila")
109 109
 #define MSG_MOTION                          _UxGT("Liike")
110
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
110
+#define MSG_FILAMENT                        _UxGT("Filament")
111 111
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm³")
112 112
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
113 113
 #define MSG_CONTRAST                        _UxGT("LCD kontrasti")

+ 1
- 1
Marlin/language_fr.h Dosyayı Görüntüle

@@ -120,7 +120,7 @@
120 120
 #define MSG_E5STEPS                         _UxGT("E5pas/mm")
121 121
 #define MSG_TEMPERATURE                     _UxGT("Tempzrature")
122 122
 #define MSG_MOTION                          _UxGT("Mouvement")
123
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
123
+#define MSG_FILAMENT                        _UxGT("Filament")
124 124
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E en mm3")
125 125
 #define MSG_FILAMENT_DIAM                   _UxGT("Diam. Fil.")
126 126
 #define MSG_CONTRAST                        _UxGT("Contraste LCD")

+ 1
- 1
Marlin/language_gl.h Dosyayı Görüntüle

@@ -116,7 +116,7 @@
116 116
 #define MSG_E5STEPS                         _UxGT("E5pasos/mm")
117 117
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
118 118
 #define MSG_MOTION                          _UxGT("Movemento")
119
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
119
+#define MSG_FILAMENT                        _UxGT("Filamento")
120 120
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E en mm3")
121 121
 #define MSG_FILAMENT_DIAM                   _UxGT("Diam. fil.")
122 122
 #define MSG_CONTRAST                        _UxGT("Constraste LCD")

+ 1
- 1
Marlin/language_hr.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Temperature")
117 117
 #define MSG_MOTION                          _UxGT("Gibanje")
118
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
118
+#define MSG_FILAMENT                        _UxGT("Filament")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
121 121
 #define MSG_CONTRAST                        _UxGT("Kontrast LCD-a")

+ 1
- 1
Marlin/language_it.h Dosyayı Görüntüle

@@ -123,7 +123,7 @@
123 123
 #define MSG_E5STEPS                         _UxGT("E5passi/mm")
124 124
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
125 125
 #define MSG_MOTION                          _UxGT("Movimento")
126
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
126
+#define MSG_FILAMENT                        _UxGT("Filamento")
127 127
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
128 128
 #define MSG_FILAMENT_DIAM                   _UxGT("Diam. filo")
129 129
 #define MSG_CONTRAST                        _UxGT("Contrasto LCD")

+ 1
- 1
Marlin/language_kana.h Dosyayı Görüntüle

@@ -151,7 +151,7 @@
151 151
 #endif
152 152
 #define MSG_TEMPERATURE                     "\xb5\xdd\xc4\xde"                                                 // "オンド" ("Temperature")
153 153
 #define MSG_MOTION                          "\xb3\xba\xde\xb7\xbe\xaf\xc3\xb2"                                 // "ウゴキセッテイ" ("Motion")
154
-#define MSG_VOLUMETRIC                      "\xcc\xa8\xd7\xd2\xdd\xc4"                                         // "フィラメント" ("Filament")
154
+#define MSG_FILAMENT                        "\xcc\xa8\xd7\xd2\xdd\xc4"                                         // "フィラメント" ("Filament")
155 155
 #define MSG_VOLUMETRIC_ENABLED              "E in mm3"
156 156
 #if LCD_WIDTH >= 20
157 157
   #define MSG_FILAMENT_DIAM                 "\xcc\xa8\xd7\xd2\xdd\xc4\xc1\xae\xaf\xb9\xb2"                     // "フィラメントチョッケイ" ("Fil. Dia.")

+ 1
- 1
Marlin/language_kana_utf8.h Dosyayı Görüntüle

@@ -125,7 +125,7 @@
125 125
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")
126 126
 #define MSG_TEMPERATURE                     _UxGT("オンド")                      // "Temperature"
127 127
 #define MSG_MOTION                          _UxGT("ウゴキセッテイ")                // "Motion"
128
-#define MSG_VOLUMETRIC                      _UxGT("フィラメント")                   // "Filament"
128
+#define MSG_FILAMENT                        _UxGT("フィラメント")                   // "Filament"
129 129
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
130 130
 #define MSG_FILAMENT_DIAM                   _UxGT("フィラメントチョッケイ")            // "Fil. Dia."
131 131
 #define MSG_CONTRAST                        _UxGT("LCDコントラスト")               // "LCD contrast"

+ 1
- 1
Marlin/language_nl.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Temperatuur")
117 117
 #define MSG_MOTION                          _UxGT("Beweging")
118
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
118
+#define MSG_FILAMENT                        _UxGT("Filament")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Dia.")
121 121
 #define MSG_CONTRAST                        _UxGT("LCD contrast")

+ 1
- 1
Marlin/language_pl.h Dosyayı Görüntüle

@@ -115,7 +115,7 @@
115 115
 #define MSG_E5STEPS                         _UxGT("krokiE5/mm")
116 116
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
117 117
 #define MSG_MOTION                          _UxGT("Ruch")
118
-#define MSG_VOLUMETRIC                      _UxGT("Filament")
118
+#define MSG_FILAMENT                        _UxGT("Filament")
119 119
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E w mm3")
120 120
 #define MSG_FILAMENT_DIAM                   _UxGT("Sr. fil.")
121 121
 #define MSG_CONTRAST                        _UxGT("Kontrast LCD")

+ 1
- 1
Marlin/language_pt-br.h Dosyayı Görüntüle

@@ -108,7 +108,7 @@
108 108
 #define MSG_E5STEPS                         "E5/mm"
109 109
 #define MSG_TEMPERATURE                     "Temperatura"
110 110
 #define MSG_MOTION                          "Movimento"
111
-#define MSG_VOLUMETRIC                      "Filamento"
111
+#define MSG_FILAMENT                        "Filamento"
112 112
 #define MSG_VOLUMETRIC_ENABLED              "Extr. em mm3"
113 113
 #define MSG_FILAMENT_DIAM                   "Diametro Fil."
114 114
 #define MSG_CONTRAST                        "Contraste"

+ 1
- 1
Marlin/language_pt-br_utf8.h Dosyayı Görüntüle

@@ -108,7 +108,7 @@
108 108
 #define MSG_E5STEPS                         _UxGT("E5/mm")
109 109
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
110 110
 #define MSG_MOTION                          _UxGT("Movimento")
111
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
111
+#define MSG_FILAMENT                        _UxGT("Filamento")
112 112
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("Extr. em mm3")
113 113
 #define MSG_FILAMENT_DIAM                   _UxGT("Diametro Fil.")
114 114
 #define MSG_CONTRAST                        _UxGT("Contraste")

+ 1
- 1
Marlin/language_pt.h Dosyayı Görüntüle

@@ -112,7 +112,7 @@
112 112
 #define MSG_E5STEPS                         "E5 passo/mm"
113 113
 #define MSG_TEMPERATURE                     "Temperatura"
114 114
 #define MSG_MOTION                          "Movimento"
115
-#define MSG_VOLUMETRIC                      "Filamento"
115
+#define MSG_FILAMENT                        "Filamento"
116 116
 #define MSG_VOLUMETRIC_ENABLED              "E em mm3"
117 117
 #define MSG_FILAMENT_DIAM                   "Fil. Diam."
118 118
 #define MSG_CONTRAST                        "Contraste"

+ 1
- 1
Marlin/language_pt_utf8.h Dosyayı Görüntüle

@@ -112,7 +112,7 @@
112 112
 #define MSG_E5STEPS                         _UxGT("E5 passo/mm")
113 113
 #define MSG_TEMPERATURE                     _UxGT("Temperatura")
114 114
 #define MSG_MOTION                          _UxGT("Movimento")
115
-#define MSG_VOLUMETRIC                      _UxGT("Filamento")
115
+#define MSG_FILAMENT                        _UxGT("Filamento")
116 116
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E em mm3")
117 117
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Diam.")
118 118
 #define MSG_CONTRAST                        _UxGT("Contraste")

+ 1
- 1
Marlin/language_ru.h Dosyayı Görüntüle

@@ -111,7 +111,7 @@
111 111
 #define MSG_E4STEPS                         _UxGT("E4 шаг/мм")
112 112
 #define MSG_TEMPERATURE                     _UxGT("Температура")
113 113
 #define MSG_MOTION                          _UxGT("Механика")
114
-#define MSG_VOLUMETRIC                      _UxGT("Пруток")
114
+#define MSG_FILAMENT                        _UxGT("Пруток")
115 115
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E в mm3")
116 116
 #define MSG_FILAMENT_DIAM                   _UxGT("Диаметр прутка")
117 117
 #define MSG_CONTRAST                        _UxGT("Контраст LCD")

+ 3
- 3
Marlin/language_test.h Dosyayı Görüntüle

@@ -148,7 +148,7 @@
148 148
   #define MSG_MAIN                            STRG_OKTAL_2
149 149
   #define MSG_TEMPERATURE                     STRG_OKTAL_3
150 150
   #define MSG_MOTION                          STRG_OKTAL_4
151
-  #define MSG_VOLUMETRIC                      STRG_OKTAL_5
151
+  #define MSG_FILAMENT                        STRG_OKTAL_5
152 152
   #define MSG_CONTRAST                        STRG_OKTAL_6
153 153
   #define MSG_RESTORE_FAILSAFE                STRG_OKTAL_7
154 154
 
@@ -183,7 +183,7 @@
183 183
   #define MSG_MAIN                            STRG_OKTAL_2
184 184
   #define MSG_TEMPERATURE                     STRG_OKTAL_3
185 185
   #define MSG_MOTION                          STRG_OKTAL_4
186
-  #define MSG_VOLUMETRIC                      STRG_OKTAL_5
186
+  #define MSG_FILAMENT                        STRG_OKTAL_5
187 187
   #define MSG_CONTRAST                        STRG_OKTAL_6
188 188
   #define MSG_RESTORE_FAILSAFE                STRG_OKTAL_7
189 189
 
@@ -218,7 +218,7 @@
218 218
   #define MSG_MAIN                            STRG_OKTAL_2
219 219
   #define MSG_TEMPERATURE                     STRG_OKTAL_3
220 220
   #define MSG_MOTION                          STRG_OKTAL_4
221
-  #define MSG_VOLUMETRIC                      STRG_OKTAL_5
221
+  #define MSG_FILAMENT                        STRG_OKTAL_5
222 222
   #define MSG_CONTRAST                        STRG_OKTAL_6
223 223
   #define MSG_RESTORE_FAILSAFE                STRG_OKTAL_7
224 224
 

+ 1
- 1
Marlin/language_tr.h Dosyayı Görüntüle

@@ -120,7 +120,7 @@
120 120
 #define MSG_E5STEPS                         _UxGT("E5steps/mm")                                         // E4steps/mm
121 121
 #define MSG_TEMPERATURE                     _UxGT("Sıcaklık")                                           // Sıcaklık
122 122
 #define MSG_MOTION                          _UxGT("Hareket")                                            // Hareket
123
-#define MSG_VOLUMETRIC                      _UxGT("Filaman")                                            // Filaman
123
+#define MSG_FILAMENT                        _UxGT("Filaman")                                            // Filaman
124 124
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E in mm3")                                           // E in mm3
125 125
 #define MSG_FILAMENT_DIAM                   _UxGT("Fil. Çap")                                           // Fil. Çap
126 126
 #define MSG_CONTRAST                        _UxGT("LCD Kontrast")                                       // LCD Kontrast

+ 1
- 1
Marlin/language_uk.h Dosyayı Görüntüle

@@ -116,7 +116,7 @@
116 116
 #define MSG_E5STEPS                         _UxGT("E5кроків/мм")
117 117
 #define MSG_TEMPERATURE                     _UxGT("Температура")
118 118
 #define MSG_MOTION                          _UxGT("Рух")
119
-#define MSG_VOLUMETRIC                      _UxGT("Волокно")
119
+#define MSG_FILAMENT                        _UxGT("Волокно")
120 120
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("E в мм3")
121 121
 #define MSG_FILAMENT_DIAM                   _UxGT("Діам. волок.")
122 122
 #define MSG_CONTRAST                        _UxGT("контраст LCD")

+ 1
- 1
Marlin/language_zh_CN.h Dosyayı Görüntüle

@@ -108,7 +108,7 @@
108 108
 #define MSG_ESTEPS                          _UxGT("挤出机步数/mm")  //"Esteps/mm"
109 109
 #define MSG_TEMPERATURE                     _UxGT("温度")  //"Temperature"
110 110
 #define MSG_MOTION                          _UxGT("运动")  //"Motion"
111
-#define MSG_VOLUMETRIC                      _UxGT("丝料测容")  //"Filament" lcd_control_volumetric_menu
111
+#define MSG_FILAMENT                        _UxGT("丝料测容")  //"Filament" lcd_control_volumetric_menu
112 112
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("测容积mm³")  //"E in mm3" volumetric_enabled
113 113
 #define MSG_FILAMENT_DIAM                   _UxGT("丝料直径")  //"Fil. Dia."
114 114
 #define MSG_CONTRAST                        _UxGT("LCD对比度")  //"LCD contrast"

+ 1
- 1
Marlin/language_zh_TW.h Dosyayı Görüntüle

@@ -108,7 +108,7 @@
108 108
 #define MSG_ESTEPS                          _UxGT("擠出機步數/mm")  //"Esteps/mm"
109 109
 #define MSG_TEMPERATURE                     _UxGT("溫度")  //"Temperature"
110 110
 #define MSG_MOTION                          _UxGT("運動")  //"Motion"
111
-#define MSG_VOLUMETRIC                      _UxGT("絲料測容")  //"Filament" lcd_control_volumetric_menu
111
+#define MSG_FILAMENT                        _UxGT("絲料測容")  //"Filament" lcd_control_volumetric_menu
112 112
 #define MSG_VOLUMETRIC_ENABLED              _UxGT("測容積mm³")  //"E in mm3" volumetric_enabled
113 113
 #define MSG_FILAMENT_DIAM                   _UxGT("絲料直徑")  //"Fil. Dia."
114 114
 #define MSG_CONTRAST                        _UxGT("LCD對比度")  //"LCD contrast"

+ 3
- 2
Marlin/planner.h Dosyayı Görüntüle

@@ -267,9 +267,10 @@ class Planner {
267 267
     #endif
268 268
 
269 269
     #if ENABLED(LIN_ADVANCE)
270
-      static void set_extruder_advance_k(const float &k) { extruder_advance_k = k; };
270
+      static void set_extruder_advance_k(float k) { extruder_advance_k = k; };
271 271
       static float get_extruder_advance_k() { return extruder_advance_k; };
272
-      static void set_advance_ed_ratio(const float &ratio) { advance_ed_ratio = ratio; };
272
+      static void set_advance_ed_ratio(float ratio) { advance_ed_ratio = ratio; };
273
+      static float get_advance_ed_ratio() { return advance_ed_ratio; };
273 274
     #endif
274 275
 
275 276
     /**

+ 244
- 185
Marlin/ultralcd.cpp Dosyayı Görüntüle

@@ -90,50 +90,25 @@ uint16_t max_display_update_time = 0;
90 90
 
91 91
 #if ENABLED(ULTIPANEL)
92 92
 
93
-  // place-holders for Ki and Kd edits
94
-  float raw_Ki, raw_Kd;
95
-
96
-  /**
97
-   * REVERSE_MENU_DIRECTION
98
-   *
99
-   * To reverse the menu direction we need a general way to reverse
100
-   * the direction of the encoder everywhere. So encoderDirection is
101
-   * added to allow the encoder to go the other way.
102
-   *
103
-   * This behavior is limited to scrolling Menus and SD card listings,
104
-   * and is disabled in other contexts.
105
-   */
106
-  #if ENABLED(REVERSE_MENU_DIRECTION)
107
-    int8_t encoderDirection = 1;
108
-    #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1)
109
-    #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1)
110
-  #else
111
-    #define ENCODER_DIRECTION_NORMAL() ;
112
-    #define ENCODER_DIRECTION_MENUS() ;
93
+  #ifndef TALL_FONT_CORRECTION
94
+    #define TALL_FONT_CORRECTION 0
113 95
   #endif
114 96
 
115
-  int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
97
+  // Function pointer to menu functions.
98
+  typedef void (*screenFunc_t)();
116 99
 
117
-  millis_t manual_move_start_time = 0;
118
-  int8_t manual_move_axis = (int8_t)NO_AXIS;
119
-  #if EXTRUDERS > 1
120
-    int8_t manual_move_e_index = 0;
121
-  #else
122
-    #define manual_move_e_index 0
100
+  #if HAS_POWER_SWITCH
101
+    extern bool powersupply;
123 102
   #endif
124 103
 
125
-  bool encoderRateMultiplierEnabled;
126
-  int32_t lastEncoderMovementMillis;
127
-
128 104
   #if ENABLED(AUTO_BED_LEVELING_UBL)
129 105
     #include "ubl.h"
130 106
   #endif
131 107
 
132
-  #if HAS_POWER_SWITCH
133
-    extern bool powersupply;
134
-  #endif
108
+  ////////////////////////////////////////////
109
+  ///////////////// Menu Tree ////////////////
110
+  ////////////////////////////////////////////
135 111
 
136
-  const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
137 112
   void lcd_main_menu();
138 113
   void lcd_tune_menu();
139 114
   void lcd_prepare_menu();
@@ -143,14 +118,7 @@ uint16_t max_display_update_time = 0;
143 118
   void lcd_control_temperature_preheat_material1_settings_menu();
144 119
   void lcd_control_temperature_preheat_material2_settings_menu();
145 120
   void lcd_control_motion_menu();
146
-  void lcd_control_volumetric_menu();
147
-
148
-  #if ENABLED(DAC_STEPPER_CURRENT)
149
-    void dac_driver_commit();
150
-    void dac_driver_getValues();
151
-    void lcd_dac_menu();
152
-    void lcd_dac_write_eeprom();
153
-  #endif
121
+  void lcd_control_filament_menu();
154 122
 
155 123
   #if ENABLED(LCD_INFO_MENU)
156 124
     #if ENABLED(PRINTCOUNTER)
@@ -173,6 +141,13 @@ uint16_t max_display_update_time = 0;
173 141
     void lcd_filament_change_resume_message();
174 142
   #endif
175 143
 
144
+  #if ENABLED(DAC_STEPPER_CURRENT)
145
+    void dac_driver_commit();
146
+    void dac_driver_getValues();
147
+    void lcd_dac_menu();
148
+    void lcd_dac_write_eeprom();
149
+  #endif
150
+
176 151
   #if HAS_LCD_CONTRAST
177 152
     void lcd_set_contrast();
178 153
   #endif
@@ -189,35 +164,40 @@ uint16_t max_display_update_time = 0;
189 164
     #include "mesh_bed_leveling.h"
190 165
   #endif
191 166
 
192
-  // Function pointer to menu functions.
193
-  typedef void (*screenFunc_t)();
167
+  ////////////////////////////////////////////
168
+  //////////// Menu System Actions ///////////
169
+  ////////////////////////////////////////////
194 170
 
195
-  // Different types of actions that can be used in menu items.
196 171
   #define menu_action_back(dummy) _menu_action_back()
197 172
   void _menu_action_back();
198 173
   void menu_action_submenu(screenFunc_t data);
199 174
   void menu_action_gcode(const char* pgcode);
200 175
   void menu_action_function(screenFunc_t data);
176
+
177
+  #define DECLARE_MENU_EDIT_TYPE(_type, _name) \
178
+    bool _menu_edit_ ## _name(); \
179
+    void menu_edit_ ## _name(); \
180
+    void menu_edit_callback_ ## _name(); \
181
+    void _menu_action_setting_edit_ ## _name(const char * const pstr, _type* const ptr, const _type minValue, const _type maxValue); \
182
+    void menu_action_setting_edit_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue); \
183
+    void menu_action_setting_edit_callback_ ## _name(const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback); \
184
+    void _menu_action_setting_edit_accessor_ ## _name(const char * const pstr, _type (*pget)(), void (*pset)(_type), const _type minValue, const _type maxValue); \
185
+    void menu_action_setting_edit_accessor_ ## _name(const char * const pstr, _type (*pget)(), void (*pset)(_type), const _type minValue, const _type maxValue); \
186
+    typedef void _name##_void
187
+
188
+  DECLARE_MENU_EDIT_TYPE(int, int3);
189
+  DECLARE_MENU_EDIT_TYPE(float, float3);
190
+  DECLARE_MENU_EDIT_TYPE(float, float32);
191
+  DECLARE_MENU_EDIT_TYPE(float, float43);
192
+  DECLARE_MENU_EDIT_TYPE(float, float5);
193
+  DECLARE_MENU_EDIT_TYPE(float, float51);
194
+  DECLARE_MENU_EDIT_TYPE(float, float52);
195
+  DECLARE_MENU_EDIT_TYPE(float, float62);
196
+  DECLARE_MENU_EDIT_TYPE(unsigned long, long5);
197
+  
201 198
   void menu_action_setting_edit_bool(const char* pstr, bool* ptr);
202
-  void menu_action_setting_edit_int3(const char* pstr, int* ptr, int minValue, int maxValue);
203
-  void menu_action_setting_edit_float3(const char* pstr, float* ptr, float minValue, float maxValue);
204
-  void menu_action_setting_edit_float32(const char* pstr, float* ptr, float minValue, float maxValue);
205
-  void menu_action_setting_edit_float43(const char* pstr, float* ptr, float minValue, float maxValue);
206
-  void menu_action_setting_edit_float5(const char* pstr, float* ptr, float minValue, float maxValue);
207
-  void menu_action_setting_edit_float51(const char* pstr, float* ptr, float minValue, float maxValue);
208
-  void menu_action_setting_edit_float52(const char* pstr, float* ptr, float minValue, float maxValue);
209
-  void menu_action_setting_edit_float62(const char* pstr, float* ptr, float minValue, float maxValue);
210
-  void menu_action_setting_edit_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue);
211 199
   void menu_action_setting_edit_callback_bool(const char* pstr, bool* ptr, screenFunc_t callbackFunc);
212
-  void menu_action_setting_edit_callback_int3(const char* pstr, int* ptr, int minValue, int maxValue, screenFunc_t callbackFunc);
213
-  void menu_action_setting_edit_callback_float3(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
214
-  void menu_action_setting_edit_callback_float32(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
215
-  void menu_action_setting_edit_callback_float43(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
216
-  void menu_action_setting_edit_callback_float5(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
217
-  void menu_action_setting_edit_callback_float51(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
218
-  void menu_action_setting_edit_callback_float52(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
219
-  void menu_action_setting_edit_callback_float62(const char* pstr, float* ptr, float minValue, float maxValue, screenFunc_t callbackFunc);
220
-  void menu_action_setting_edit_callback_long5(const char* pstr, unsigned long* ptr, unsigned long minValue, unsigned long maxValue, screenFunc_t callbackFunc);
200
+  void menu_action_setting_edit_accessor_bool(const char* pstr, bool (*pget)(), void (*pset)(bool));
221 201
 
222 202
   #if ENABLED(SDSUPPORT)
223 203
     void lcd_sdcard_menu();
@@ -225,7 +205,9 @@ uint16_t max_display_update_time = 0;
225 205
     void menu_action_sddirectory(const char* filename, char* longFilename);
226 206
   #endif
227 207
 
228
-  /* Helper macros for menus */
208
+  ////////////////////////////////////////////
209
+  //////////// Menu System Macros ////////////
210
+  ////////////////////////////////////////////
229 211
 
230 212
   #ifndef ENCODER_FEEDRATE_DEADZONE
231 213
     #define ENCODER_FEEDRATE_DEADZONE 10
@@ -237,59 +219,6 @@ uint16_t max_display_update_time = 0;
237 219
     #define ENCODER_PULSES_PER_STEP 1
238 220
   #endif
239 221
 
240
-  #ifndef TALL_FONT_CORRECTION
241
-    #define TALL_FONT_CORRECTION 0
242
-  #endif
243
-
244
-  /**
245
-   * START_SCREEN_OR_MENU generates init code for a screen or menu
246
-   *
247
-   *   encoderLine is the position based on the encoder
248
-   *   encoderTopLine is the top menu line to display
249
-   *   _lcdLineNr is the index of the LCD line (e.g., 0-3)
250
-   *   _menuLineNr is the menu item to draw and process
251
-   *   _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
252
-   *   _countedItems is the total number of items in the menu (after one call)
253
-   */
254
-  #define START_SCREEN_OR_MENU(LIMIT) \
255
-    ENCODER_DIRECTION_MENUS(); \
256
-    encoderRateMultiplierEnabled = false; \
257
-    if (encoderPosition > 0x8000) encoderPosition = 0; \
258
-    static int8_t _countedItems = 0; \
259
-    int8_t encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); \
260
-    if (_countedItems > 0 && encoderLine >= _countedItems - (LIMIT)) { \
261
-      encoderLine = max(0, _countedItems - (LIMIT)); \
262
-      encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \
263
-    }
264
-
265
-  #define SCREEN_OR_MENU_LOOP() \
266
-    int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
267
-    for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT - (TALL_FONT_CORRECTION); _lcdLineNr++, _menuLineNr++) { \
268
-      _thisItemNr = 0
269
-
270
-  /**
271
-   * START_SCREEN  Opening code for a screen having only static items.
272
-   *               Do simplified scrolling of the entire screen.
273
-   *
274
-   * START_MENU    Opening code for a screen with menu items.
275
-   *               Scroll as-needed to keep the selected line in view.
276
-   */
277
-  #define START_SCREEN() \
278
-    START_SCREEN_OR_MENU(LCD_HEIGHT - (TALL_FONT_CORRECTION)); \
279
-    encoderTopLine = encoderLine; \
280
-    bool _skipStatic = false; \
281
-    SCREEN_OR_MENU_LOOP()
282
-
283
-  #define START_MENU() \
284
-    START_SCREEN_OR_MENU(1); \
285
-    screen_changed = false; \
286
-    NOMORE(encoderTopLine, encoderLine); \
287
-    if (encoderLine >= encoderTopLine + LCD_HEIGHT - (TALL_FONT_CORRECTION)) { \
288
-      encoderTopLine = encoderLine - (LCD_HEIGHT - (TALL_FONT_CORRECTION) - 1); \
289
-    } \
290
-    bool _skipStatic = true; \
291
-    SCREEN_OR_MENU_LOOP()
292
-
293 222
   /**
294 223
    * MENU_ITEM generates draw & handler code for a menu item, potentially calling:
295 224
    *
@@ -347,17 +276,11 @@ uint16_t max_display_update_time = 0;
347 276
     } \
348 277
     ++_thisItemNr
349 278
 
350
-  #define END_SCREEN() \
351
-    } \
352
-    _countedItems = _thisItemNr
353
-
354
-  #define END_MENU() \
355
-    } \
356
-    _countedItems = _thisItemNr; \
357
-    UNUSED(_skipStatic)
358
-
359 279
   #if ENABLED(ENCODER_RATE_MULTIPLIER)
360 280
 
281
+    bool encoderRateMultiplierEnabled;
282
+    #define ENCODER_RATE_MULTIPLY(F) (encoderRateMultiplierEnabled = F)
283
+
361 284
     //#define ENCODER_RATE_MULTIPLIER_DEBUG  // If defined, output the encoder steps per second value
362 285
 
363 286
     /**
@@ -370,55 +293,155 @@ uint16_t max_display_update_time = 0;
370 293
         _MENU_ITEM_PART_2(type, ## __VA_ARGS__); \
371 294
       } while(0)
372 295
 
373
-  #endif //ENCODER_RATE_MULTIPLIER
296
+  #else  // !ENCODER_RATE_MULTIPLIER
297
+    #define ENCODER_RATE_MULTIPLY(F) NOOP
298
+  #endif // !ENCODER_RATE_MULTIPLIER
374 299
 
375 300
   #define MENU_ITEM_DUMMY() do { _thisItemNr++; } while(0)
376 301
   #define MENU_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
377 302
   #define MENU_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
303
+  #define MENU_ITEM_EDIT_ACCESSOR(type, label, ...) MENU_ITEM(setting_edit_accessor_ ## type, label, PSTR(label), ## __VA_ARGS__)
378 304
   #if ENABLED(ENCODER_RATE_MULTIPLIER)
379 305
     #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
380 306
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
307
+    #define MENU_MULTIPLIER_ITEM_EDIT_ACCESSOR(type, label, ...) MENU_MULTIPLIER_ITEM(setting_edit_accessor_ ## type, label, PSTR(label), ## __VA_ARGS__)
381 308
   #else //!ENCODER_RATE_MULTIPLIER
382 309
     #define MENU_MULTIPLIER_ITEM_EDIT(type, label, ...) MENU_ITEM(setting_edit_ ## type, label, PSTR(label), ## __VA_ARGS__)
383 310
     #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, ...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## __VA_ARGS__)
311
+    #define MENU_MULTIPLIER_ITEM_EDIT_ACCESSOR(type, label, ...) MENU_ITEM(setting_edit_accessor_ ## type, label, PSTR(label), ## __VA_ARGS__)
384 312
   #endif //!ENCODER_RATE_MULTIPLIER
385 313
 
386
-  /** Used variables to keep track of the menu */
387
-  volatile uint8_t buttons;  //the last checked buttons in a bit array.
388
-  #if ENABLED(REPRAPWORLD_KEYPAD)
389
-    volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
390
-  #endif
314
+  /**
315
+   * START_SCREEN_OR_MENU generates init code for a screen or menu
316
+   *
317
+   *   encoderLine is the position based on the encoder
318
+   *   encoderTopLine is the top menu line to display
319
+   *   _lcdLineNr is the index of the LCD line (e.g., 0-3)
320
+   *   _menuLineNr is the menu item to draw and process
321
+   *   _thisItemNr is the index of each MENU_ITEM or STATIC_ITEM
322
+   *   _countedItems is the total number of items in the menu (after one call)
323
+   */
324
+  #define START_SCREEN_OR_MENU(LIMIT) \
325
+    ENCODER_DIRECTION_MENUS(); \
326
+    ENCODER_RATE_MULTIPLY(false); \
327
+    if (encoderPosition > 0x8000) encoderPosition = 0; \
328
+    static int8_t _countedItems = 0; \
329
+    int8_t encoderLine = encoderPosition / (ENCODER_STEPS_PER_MENU_ITEM); \
330
+    if (_countedItems > 0 && encoderLine >= _countedItems - (LIMIT)) { \
331
+      encoderLine = max(0, _countedItems - (LIMIT)); \
332
+      encoderPosition = encoderLine * (ENCODER_STEPS_PER_MENU_ITEM); \
333
+    }
391 334
 
392
-  #if ENABLED(LCD_HAS_SLOW_BUTTONS)
393
-    volatile uint8_t slow_buttons; // Bits of the pressed buttons.
335
+  #define SCREEN_OR_MENU_LOOP() \
336
+    int8_t _menuLineNr = encoderTopLine, _thisItemNr; \
337
+    for (int8_t _lcdLineNr = 0; _lcdLineNr < LCD_HEIGHT - (TALL_FONT_CORRECTION); _lcdLineNr++, _menuLineNr++) { \
338
+      _thisItemNr = 0
339
+
340
+  /**
341
+   * START_SCREEN  Opening code for a screen having only static items.
342
+   *               Do simplified scrolling of the entire screen.
343
+   *
344
+   * START_MENU    Opening code for a screen with menu items.
345
+   *               Scroll as-needed to keep the selected line in view.
346
+   */
347
+  #define START_SCREEN() \
348
+    START_SCREEN_OR_MENU(LCD_HEIGHT - (TALL_FONT_CORRECTION)); \
349
+    encoderTopLine = encoderLine; \
350
+    bool _skipStatic = false; \
351
+    SCREEN_OR_MENU_LOOP()
352
+
353
+  #define START_MENU() \
354
+    START_SCREEN_OR_MENU(1); \
355
+    screen_changed = false; \
356
+    NOMORE(encoderTopLine, encoderLine); \
357
+    if (encoderLine >= encoderTopLine + LCD_HEIGHT - (TALL_FONT_CORRECTION)) { \
358
+      encoderTopLine = encoderLine - (LCD_HEIGHT - (TALL_FONT_CORRECTION) - 1); \
359
+    } \
360
+    bool _skipStatic = true; \
361
+    SCREEN_OR_MENU_LOOP()
362
+
363
+  #define END_SCREEN() \
364
+    } \
365
+    _countedItems = _thisItemNr
366
+
367
+  #define END_MENU() \
368
+    } \
369
+    _countedItems = _thisItemNr; \
370
+    UNUSED(_skipStatic)
371
+
372
+  ////////////////////////////////////////////
373
+  ///////////// Global Variables /////////////
374
+  ////////////////////////////////////////////
375
+
376
+  /**
377
+   * REVERSE_MENU_DIRECTION
378
+   *
379
+   * To reverse the menu direction we need a general way to reverse
380
+   * the direction of the encoder everywhere. So encoderDirection is
381
+   * added to allow the encoder to go the other way.
382
+   *
383
+   * This behavior is limited to scrolling Menus and SD card listings,
384
+   * and is disabled in other contexts.
385
+   */
386
+  #if ENABLED(REVERSE_MENU_DIRECTION)
387
+    int8_t encoderDirection = 1;
388
+    #define ENCODER_DIRECTION_NORMAL() (encoderDirection = 1)
389
+    #define ENCODER_DIRECTION_MENUS() (encoderDirection = -1)
390
+  #else
391
+    #define ENCODER_DIRECTION_NORMAL() ;
392
+    #define ENCODER_DIRECTION_MENUS() ;
394 393
   #endif
395
-  int8_t encoderTopLine;              /* scroll offset in the current menu */
396
-  millis_t next_button_update_ms;
397
-  uint8_t lastEncoderBits;
394
+
395
+  // Encoder Movement
396
+  volatile int8_t encoderDiff; // Updated in lcd_buttons_update, added to encoderPosition every LCD update
398 397
   uint32_t encoderPosition;
399
-  #if PIN_EXISTS(SD_DETECT)
400
-    uint8_t lcd_sd_status;
398
+  millis_t lastEncoderMovementMillis = 0;
399
+
400
+  // Button States
401
+  bool lcd_clicked, wait_for_unclick;
402
+  volatile uint8_t buttons;
403
+  millis_t next_button_update_ms;
404
+  #if ENABLED(REPRAPWORLD_KEYPAD)
405
+    volatile uint8_t buttons_reprapworld_keypad;
406
+  #endif
407
+  #if ENABLED(LCD_HAS_SLOW_BUTTONS)
408
+    volatile uint8_t slow_buttons;
401 409
   #endif
402 410
 
411
+  // Menu System Navigation
412
+  screenFunc_t currentScreen = lcd_status_screen;
413
+  int8_t encoderTopLine;
403 414
   typedef struct {
404 415
     screenFunc_t menu_function;
405 416
     uint32_t encoder_position;
406 417
   } menuPosition;
418
+  menuPosition screen_history[6];
419
+  uint8_t screen_history_depth = 0;
420
+  bool screen_changed, defer_return_to_status;
407 421
 
408
-  screenFunc_t currentScreen = lcd_status_screen; // pointer to the currently active menu handler
422
+  // Value Editing
423
+  const char *editLabel;
424
+  void *editValue, *editSetter;
425
+  int32_t minEditValue, maxEditValue;
426
+  screenFunc_t callbackFunc;
409 427
 
410
-  menuPosition screen_history[10];
411
-  uint8_t screen_history_depth = 0;
412
-  bool screen_changed;
428
+  // Manual Moves
429
+  const float manual_feedrate_mm_m[] = MANUAL_FEEDRATE;
430
+  millis_t manual_move_start_time = 0;
431
+  int8_t manual_move_axis = (int8_t)NO_AXIS;
432
+  #if EXTRUDERS > 1
433
+    int8_t manual_move_e_index = 0;
434
+  #else
435
+    #define manual_move_e_index 0
436
+  #endif
413 437
 
414
-  // LCD and menu clicks
415
-  bool lcd_clicked, wait_for_unclick, defer_return_to_status;
438
+  #if PIN_EXISTS(SD_DETECT)
439
+    uint8_t lcd_sd_status;
440
+  #endif
416 441
 
417
-  // Variables used when editing values.
418
-  const char* editLabel;
419
-  void* editValue;
420
-  int32_t minEditValue, maxEditValue;
421
-  screenFunc_t callbackFunc;              // call this after editing
442
+  #if ENABLED(PIDTEMP)
443
+    float raw_Ki, raw_Kd; // place-holders for Ki and Kd edits
444
+  #endif
422 445
 
423 446
   /**
424 447
    * General function to go directly to a screen
@@ -519,7 +542,7 @@ void lcd_status_screen() {
519 542
 
520 543
   #if ENABLED(ULTIPANEL)
521 544
     ENCODER_DIRECTION_NORMAL();
522
-    encoderRateMultiplierEnabled = false;
545
+    ENCODER_RATE_MULTIPLY(false);
523 546
   #endif
524 547
 
525 548
   #if ENABLED(LCD_PROGRESS_BAR)
@@ -2105,7 +2128,7 @@ void kill_screen(const char* lcd_msg) {
2105 2128
     MENU_BACK(MSG_MAIN);
2106 2129
     MENU_ITEM(submenu, MSG_TEMPERATURE, lcd_control_temperature_menu);
2107 2130
     MENU_ITEM(submenu, MSG_MOTION, lcd_control_motion_menu);
2108
-    MENU_ITEM(submenu, MSG_VOLUMETRIC, lcd_control_volumetric_menu);
2131
+    MENU_ITEM(submenu, MSG_FILAMENT, lcd_control_filament_menu);
2109 2132
 
2110 2133
     #if HAS_LCD_CONTRAST
2111 2134
       //MENU_ITEM_EDIT(int3, MSG_CONTRAST, &lcd_contrast, 0, 63);
@@ -2177,28 +2200,28 @@ void kill_screen(const char* lcd_msg) {
2177 2200
       PID_PARAM(Kd, e) = scalePID_d(raw_Kd);
2178 2201
       thermalManager.updatePID();
2179 2202
     }
2180
-    #define _PIDTEMP_BASE_FUNCTIONS(N) \
2203
+    #define _DEFINE_PIDTEMP_BASE_FUNCS(N) \
2181 2204
       void copy_and_scalePID_i_E ## N() { copy_and_scalePID_i(N); } \
2182 2205
       void copy_and_scalePID_d_E ## N() { copy_and_scalePID_d(N); }
2183 2206
 
2184 2207
     #if ENABLED(PID_AUTOTUNE_MENU)
2185
-      #define _PIDTEMP_FUNCTIONS(N) \
2186
-        _PIDTEMP_BASE_FUNCTIONS(N); \
2187
-        void lcd_autotune_callback_E ## N() { _lcd_autotune(N); }
2208
+      #define DEFINE_PIDTEMP_FUNCS(N) \
2209
+        _DEFINE_PIDTEMP_BASE_FUNCS(N); \
2210
+        void lcd_autotune_callback_E ## N() { _lcd_autotune(N); } typedef void _pid_##N##_void
2188 2211
     #else
2189
-      #define _PIDTEMP_FUNCTIONS(N) _PIDTEMP_BASE_FUNCTIONS(N)
2212
+      #define DEFINE_PIDTEMP_FUNCS(N) _DEFINE_PIDTEMP_BASE_FUNCS(N) typedef void _pid_##N##_void
2190 2213
     #endif
2191 2214
 
2192
-    _PIDTEMP_FUNCTIONS(0)
2215
+    DEFINE_PIDTEMP_FUNCS(0);
2193 2216
     #if ENABLED(PID_PARAMS_PER_HOTEND)
2194 2217
       #if HOTENDS > 1
2195
-        _PIDTEMP_FUNCTIONS(1)
2218
+        DEFINE_PIDTEMP_FUNCS(1);
2196 2219
         #if HOTENDS > 2
2197
-          _PIDTEMP_FUNCTIONS(2)
2220
+          DEFINE_PIDTEMP_FUNCS(2);
2198 2221
           #if HOTENDS > 3
2199
-            _PIDTEMP_FUNCTIONS(3)
2222
+            DEFINE_PIDTEMP_FUNCS(3);
2200 2223
             #if HOTENDS > 4
2201
-              _PIDTEMP_FUNCTIONS(4)
2224
+              DEFINE_PIDTEMP_FUNCS(4);
2202 2225
             #endif // HOTENDS > 4
2203 2226
           #endif // HOTENDS > 3
2204 2227
         #endif // HOTENDS > 2
@@ -2543,10 +2566,14 @@ void kill_screen(const char* lcd_msg) {
2543 2566
    * "Control" > "Filament" submenu
2544 2567
    *
2545 2568
    */
2546
-  void lcd_control_volumetric_menu() {
2569
+  void lcd_control_filament_menu() {
2547 2570
     START_MENU();
2548 2571
     MENU_BACK(MSG_CONTROL);
2549 2572
 
2573
+    #if ENABLED(LIN_ADVANCE)
2574
+      MENU_ITEM_EDIT_ACCESSOR(float3, MSG_ADVANCE_K, planner.get_extruder_advance_k, planner.set_extruder_advance_k, 0, 999);
2575
+    #endif
2576
+
2550 2577
     MENU_ITEM_EDIT_CALLBACK(bool, MSG_VOLUMETRIC_ENABLED, &volumetric_enabled, calculate_volumetric_multipliers);
2551 2578
 
2552 2579
     if (volumetric_enabled) {
@@ -2647,7 +2674,7 @@ void kill_screen(const char* lcd_msg) {
2647 2674
     void lcd_sdcard_menu() {
2648 2675
       ENCODER_DIRECTION_MENUS();
2649 2676
       if (!lcdDrawUpdate && !lcd_clicked) return; // nothing to do (so don't thrash the SD card)
2650
-      uint16_t fileCnt = card.getnrfilenames();
2677
+      const uint16_t fileCnt = card.getnrfilenames();
2651 2678
       START_MENU();
2652 2679
       MENU_BACK(MSG_MAIN);
2653 2680
       card.getWorkDirName();
@@ -2662,11 +2689,11 @@ void kill_screen(const char* lcd_msg) {
2662 2689
 
2663 2690
       for (uint16_t i = 0; i < fileCnt; i++) {
2664 2691
         if (_menuLineNr == _thisItemNr) {
2665
-          #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
2666
-            int nr = fileCnt - 1 - i;
2667
-          #else
2668
-            int nr = i;
2669
-          #endif
2692
+          const uint16_t nr =
2693
+            #if ENABLED(SDCARD_RATHERRECENTFIRST) && DISABLED(SDCARD_SORT_ALPHA)
2694
+              fileCnt - 1 -
2695
+            #endif
2696
+          i;
2670 2697
 
2671 2698
           #if ENABLED(SDCARD_SORT_ALPHA)
2672 2699
             card.getfilename_sorted(nr);
@@ -3091,9 +3118,9 @@ void kill_screen(const char* lcd_msg) {
3091 3118
    *
3092 3119
    * Functions for editing single values
3093 3120
    *
3094
-   * The "menu_edit_type" macro generates the functions needed to edit a numerical value.
3121
+   * The "DEFINE_MENU_EDIT_TYPE" macro generates the functions needed to edit a numerical value.
3095 3122
    *
3096
-   * For example, menu_edit_type(int, int3, itostr3, 1) expands into these functions:
3123
+   * For example, DEFINE_MENU_EDIT_TYPE(int, int3, itostr3, 1) expands into these functions:
3097 3124
    *
3098 3125
    *   bool _menu_edit_int3();
3099 3126
    *   void menu_edit_int3(); // edit int (interactively)
@@ -3101,6 +3128,8 @@ void kill_screen(const char* lcd_msg) {
3101 3128
    *   void _menu_action_setting_edit_int3(const char * const pstr, int * const ptr, const int minValue, const int maxValue);
3102 3129
    *   void menu_action_setting_edit_int3(const char * const pstr, int * const ptr, const int minValue, const int maxValue);
3103 3130
    *   void menu_action_setting_edit_callback_int3(const char * const pstr, int * const ptr, const int minValue, const int maxValue, const screenFunc_t callback); // edit int with callback
3131
+   *   void _menu_action_setting_edit_accessor_int3(const char * const pstr, int (*pget)(), void (*pset)(int), const int minValue, const int maxValue);
3132
+   *   void menu_action_setting_edit_accessor_int3(const char * const pstr, int (*pget)(), void (*pset)(int), const int minValue, const int maxValue); // edit int via pget and pset accessor functions
3104 3133
    *
3105 3134
    * You can then use one of the menu macros to present the edit interface:
3106 3135
    *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_percentage, 10, 999)
@@ -3112,8 +3141,11 @@ void kill_screen(const char* lcd_msg) {
3112 3141
    * Also: MENU_MULTIPLIER_ITEM_EDIT, MENU_ITEM_EDIT_CALLBACK, and MENU_MULTIPLIER_ITEM_EDIT_CALLBACK
3113 3142
    *
3114 3143
    *       menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_percentage, 10, 999)
3144
+   *
3145
+   * Values that are get/set via functions (As opposed to global variables) can use the accessor form:
3146
+   *   MENU_ITEM_EDIT_ACCESSOR(int3, MSG_SPEED, get_feedrate_percentage, set_feedrate_percentage, 10, 999)
3115 3147
    */
3116
-  #define menu_edit_type(_type, _name, _strFunc, _scale) \
3148
+  #define DEFINE_MENU_EDIT_TYPE(_type, _name, _strFunc, _scale) \
3117 3149
     bool _menu_edit_ ## _name () { \
3118 3150
       ENCODER_DIRECTION_NORMAL(); \
3119 3151
       if ((int32_t)encoderPosition < 0) encoderPosition = 0; \
@@ -3121,7 +3153,11 @@ void kill_screen(const char* lcd_msg) {
3121 3153
       if (lcdDrawUpdate) \
3122 3154
         lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale))); \
3123 3155
       if (lcd_clicked) { \
3124
-        *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale); \
3156
+        _type value = ((_type)((int32_t)encoderPosition + minEditValue)) * (1.0 / _scale); \
3157
+        if (editValue != NULL) \
3158
+          *((_type*)editValue) = value; \
3159
+        else if (editSetter != NULL) \
3160
+          ((void (*)(_type))editSetter)(value); \
3125 3161
         lcd_goto_previous_menu(); \
3126 3162
       } \
3127 3163
       return lcd_clicked; \
@@ -3135,6 +3171,7 @@ void kill_screen(const char* lcd_msg) {
3135 3171
       \
3136 3172
       editLabel = pstr; \
3137 3173
       editValue = ptr; \
3174
+      editSetter = NULL; \
3138 3175
       minEditValue = minValue * _scale; \
3139 3176
       maxEditValue = maxValue * _scale - minEditValue; \
3140 3177
       encoderPosition = (*ptr) * _scale - minEditValue; \
@@ -3142,23 +3179,39 @@ void kill_screen(const char* lcd_msg) {
3142 3179
     void menu_action_setting_edit_ ## _name (const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue) { \
3143 3180
       _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
3144 3181
       currentScreen = menu_edit_ ## _name; \
3145
-    }\
3182
+    } \
3146 3183
     void menu_action_setting_edit_callback_ ## _name (const char * const pstr, _type * const ptr, const _type minValue, const _type maxValue, const screenFunc_t callback) { \
3147 3184
       _menu_action_setting_edit_ ## _name(pstr, ptr, minValue, maxValue); \
3148 3185
       currentScreen = menu_edit_callback_ ## _name; \
3149 3186
       callbackFunc = callback; \
3150 3187
     } \
3188
+    void _menu_action_setting_edit_accessor_ ## _name (const char * const pstr, _type (*pget)(), void (*pset)(_type), const _type minValue, const _type maxValue) { \
3189
+      lcd_save_previous_screen(); \
3190
+      \
3191
+      lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; \
3192
+      \
3193
+      editLabel = pstr; \
3194
+      editValue = NULL; \
3195
+      editSetter = pset; \
3196
+      minEditValue = minValue * _scale; \
3197
+      maxEditValue = maxValue * _scale - minEditValue; \
3198
+      encoderPosition = pget() * _scale - minEditValue; \
3199
+    } \
3200
+    void menu_action_setting_edit_accessor_ ## _name (const char * const pstr, _type (*pget)(), void (*pset)(_type), const _type minValue, const _type maxValue) { \
3201
+      _menu_action_setting_edit_accessor_ ## _name(pstr, pget, pset, minValue, maxValue); \
3202
+      currentScreen = menu_edit_ ## _name; \
3203
+    } \
3151 3204
     typedef void _name
3152 3205
 
3153
-  menu_edit_type(int, int3, itostr3, 1);
3154
-  menu_edit_type(float, float3, ftostr3, 1.0);
3155
-  menu_edit_type(float, float32, ftostr32, 100.0);
3156
-  menu_edit_type(float, float43, ftostr43sign, 1000.0);
3157
-  menu_edit_type(float, float5, ftostr5rj, 0.01);
3158
-  menu_edit_type(float, float51, ftostr51sign, 10.0);
3159
-  menu_edit_type(float, float52, ftostr52sign, 100.0);
3160
-  menu_edit_type(float, float62, ftostr62rj, 100.0);
3161
-  menu_edit_type(unsigned long, long5, ftostr5rj, 0.01);
3206
+  DEFINE_MENU_EDIT_TYPE(int, int3, itostr3, 1);
3207
+  DEFINE_MENU_EDIT_TYPE(float, float3, ftostr3, 1.0);
3208
+  DEFINE_MENU_EDIT_TYPE(float, float32, ftostr32, 100.0);
3209
+  DEFINE_MENU_EDIT_TYPE(float, float43, ftostr43sign, 1000.0);
3210
+  DEFINE_MENU_EDIT_TYPE(float, float5, ftostr5rj, 0.01);
3211
+  DEFINE_MENU_EDIT_TYPE(float, float51, ftostr51sign, 10.0);
3212
+  DEFINE_MENU_EDIT_TYPE(float, float52, ftostr52sign, 100.0);
3213
+  DEFINE_MENU_EDIT_TYPE(float, float62, ftostr62rj, 100.0);
3214
+  DEFINE_MENU_EDIT_TYPE(unsigned long, long5, ftostr5rj, 0.01);
3162 3215
 
3163 3216
   /**
3164 3217
    *
@@ -3252,6 +3305,11 @@ void kill_screen(const char* lcd_msg) {
3252 3305
     menu_action_setting_edit_bool(pstr, ptr);
3253 3306
     (*callback)();
3254 3307
   }
3308
+  void menu_action_setting_edit_accessor_bool(const char* pstr, bool (*pget)(), void (*pset)(bool)) {
3309
+    UNUSED(pstr);
3310
+    pset(!pget());
3311
+    lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW;
3312
+  }
3255 3313
 
3256 3314
 #endif // ULTIPANEL
3257 3315
 
@@ -3422,7 +3480,7 @@ void lcd_update() {
3422 3480
 
3423 3481
   #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
3424 3482
 
3425
-    bool sd_status = IS_SD_INSERTED;
3483
+    const bool sd_status = IS_SD_INSERTED;
3426 3484
     if (sd_status != lcd_sd_status && lcd_detected()) {
3427 3485
 
3428 3486
       if (sd_status) {
@@ -3445,7 +3503,7 @@ void lcd_update() {
3445 3503
 
3446 3504
   #endif //SDSUPPORT && SD_DETECT_PIN
3447 3505
 
3448
-  millis_t ms = millis();
3506
+  const millis_t ms = millis();
3449 3507
   if (ELAPSED(ms, next_lcd_update_ms)
3450 3508
     #if ENABLED(DOGLCD)
3451 3509
       || drawing_screen
@@ -3715,6 +3773,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
3715 3773
    * Warning: This function is called from interrupt context!
3716 3774
    */
3717 3775
   void lcd_buttons_update() {
3776
+    static uint8_t lastEncoderBits;
3718 3777
     millis_t now = millis();
3719 3778
     if (ELAPSED(now, next_button_update_ms)) {
3720 3779
 

+ 23
- 19
Marlin/ultralcd_impl_DOGM.h Dosyayı Görüntüle

@@ -771,27 +771,31 @@ static void lcd_implementation_status_screen() {
771 771
   #define lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, false)
772 772
   #define lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, data) _drawmenu_setting_edit_generic(sel, row, pstr, data, true)
773 773
 
774
-  #define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
775
-  #define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
776
-  #define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
777
-  #define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
778
-  #define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
779
-  #define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
780
-  #define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
781
-  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62rj(*(data)))
782
-  #define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
783
-  #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
774
+  #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \
775
+    inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
776
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, _strFunc(*(data))); \
777
+    } \
778
+    inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
779
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, _strFunc(*(data))); \
780
+    } \
781
+    inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type (*pget)(), void (*pset)(_type), ...) { \
782
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, _strFunc(pget())); \
783
+    } \
784
+    typedef void _name##_void
785
+
786
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int, int3, itostr3);
787
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3);
788
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float32, ftostr32);
789
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign);
790
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj);
791
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign);
792
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52sign);
793
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj);
794
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(long, long5, ftostr5rj);
784 795
 
785
-  #define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, itostr3(*(data)))
786
-  #define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr3(*(data)))
787
-  #define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr32(*(data)))
788
-  #define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr43sign(*(data)))
789
-  #define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
790
-  #define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr52sign(*(data)))
791
-  #define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr51sign(*(data)))
792
-  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr62rj(*(data)))
793
-  #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, ftostr5rj(*(data)))
796
+  #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
794 797
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
798
+  #define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
795 799
 
796 800
   void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) {
797 801
     const uint8_t labellen = lcd_strlen_P(pstr),

+ 23
- 20
Marlin/ultralcd_impl_HD44780.h Dosyayı Görüntüle

@@ -874,28 +874,31 @@ static void lcd_implementation_status_screen() {
874 874
     lcd_printPGM(data);
875 875
   }
876 876
 
877
-  #define lcd_implementation_drawmenu_setting_edit_int3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data)))
878
-  #define lcd_implementation_drawmenu_setting_edit_float3(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data)))
879
-  #define lcd_implementation_drawmenu_setting_edit_float32(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data)))
880
-  #define lcd_implementation_drawmenu_setting_edit_float43(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data)))
881
-  #define lcd_implementation_drawmenu_setting_edit_float5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
882
-  #define lcd_implementation_drawmenu_setting_edit_float52(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
883
-  #define lcd_implementation_drawmenu_setting_edit_float51(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
884
-  #define lcd_implementation_drawmenu_setting_edit_float62(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62rj(*(data)))
885
-  #define lcd_implementation_drawmenu_setting_edit_long5(sel, row, pstr, pstr2, data, minValue, maxValue) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
886
-  #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
877
+  #define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \
878
+    inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
879
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', _strFunc(*(data))); \
880
+    } \
881
+    inline void lcd_implementation_drawmenu_setting_edit_callback_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
882
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', _strFunc(*(data))); \
883
+    } \
884
+    inline void lcd_implementation_drawmenu_setting_edit_accessor_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type (*pget)(), void (*pset)(_type), ...) { \
885
+      lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', _strFunc(pget())); \
886
+    } \
887
+    typedef void _name##_void
888
+
889
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(int, int3, itostr3);
890
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float3, ftostr3);
891
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float32, ftostr32);
892
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float43, ftostr43sign);
893
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float5, ftostr5rj);
894
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float51, ftostr51sign);
895
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float52, ftostr52sign);
896
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(float, float62, ftostr62rj);
897
+  DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(long, long5, ftostr5rj);
887 898
 
888
-  //Add version for callback functions
889
-  #define lcd_implementation_drawmenu_setting_edit_callback_int3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', itostr3(*(data)))
890
-  #define lcd_implementation_drawmenu_setting_edit_callback_float3(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr3(*(data)))
891
-  #define lcd_implementation_drawmenu_setting_edit_callback_float32(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr32(*(data)))
892
-  #define lcd_implementation_drawmenu_setting_edit_callback_float43(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr43sign(*(data)))
893
-  #define lcd_implementation_drawmenu_setting_edit_callback_float5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
894
-  #define lcd_implementation_drawmenu_setting_edit_callback_float52(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr52sign(*(data)))
895
-  #define lcd_implementation_drawmenu_setting_edit_callback_float51(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr51sign(*(data)))
896
-  #define lcd_implementation_drawmenu_setting_edit_callback_float62(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr62rj(*(data)))
897
-  #define lcd_implementation_drawmenu_setting_edit_callback_long5(sel, row, pstr, pstr2, data, minValue, maxValue, callback) lcd_implementation_drawmenu_setting_edit_generic(sel, row, pstr, '>', ftostr5rj(*(data)))
899
+  #define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
898 900
   #define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
901
+  #define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, '>', (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
899 902
 
900 903
   void lcd_implementation_drawedit(const char* pstr, const char* const value=NULL) {
901 904
     lcd.setCursor(1, 1);

Loading…
İptal
Kaydet