Browse Source

Apply LINEAR_UNIT to M503 output for M200

Scott Lahteine 7 years ago
parent
commit
a9ecb975b2
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      Marlin/src/module/configuration_store.cpp

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

@@ -1487,15 +1487,15 @@ void MarlinSettings::reset() {
1487 1487
      */
1488 1488
     CONFIG_ECHO_START;
1489 1489
     #if ENABLED(INCH_MODE_SUPPORT)
1490
-      #define LINEAR_UNIT(N) ((N) / parser.linear_unit_factor)
1491
-      #define VOLUMETRIC_UNIT(N) ((N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1490
+      #define LINEAR_UNIT(N) (float(N) / parser.linear_unit_factor)
1491
+      #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1492 1492
       SERIAL_ECHOPGM("  G2");
1493 1493
       SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0');
1494 1494
       SERIAL_ECHOPGM(" ; Units in ");
1495 1495
       serialprintPGM(parser.linear_unit_factor == 1.0 ? PSTR("mm\n") : PSTR("inches\n"));
1496 1496
     #else
1497
-      #define LINEAR_UNIT(N) N
1498
-      #define VOLUMETRIC_UNIT(N) N
1497
+      #define LINEAR_UNIT(N) (N)
1498
+      #define VOLUMETRIC_UNIT(N) (N)
1499 1499
       SERIAL_ECHOLNPGM("  G21    ; Units in mm");
1500 1500
     #endif
1501 1501
 
@@ -1511,7 +1511,7 @@ void MarlinSettings::reset() {
1511 1511
         SERIAL_ECHOPGM(" ; Units in ");
1512 1512
         serialprintPGM(parser.temp_units_name());
1513 1513
       #else
1514
-        #define TEMP_UNIT(N) N
1514
+        #define TEMP_UNIT(N) (N)
1515 1515
         SERIAL_ECHOLNPGM("  M149 C ; Units in Celsius");
1516 1516
       #endif
1517 1517
 
@@ -1532,23 +1532,23 @@ void MarlinSettings::reset() {
1532 1532
     }
1533 1533
 
1534 1534
     CONFIG_ECHO_START;
1535
-    SERIAL_ECHOPAIR("  M200 D", planner.filament_size[0]);
1535
+    SERIAL_ECHOPAIR("  M200 D", LINEAR_UNIT(planner.filament_size[0]));
1536 1536
     SERIAL_EOL();
1537 1537
     #if EXTRUDERS > 1
1538 1538
       CONFIG_ECHO_START;
1539
-      SERIAL_ECHOPAIR("  M200 T1 D", planner.filament_size[1]);
1539
+      SERIAL_ECHOPAIR("  M200 T1 D", LINEAR_UNIT(planner.filament_size[1]));
1540 1540
       SERIAL_EOL();
1541 1541
       #if EXTRUDERS > 2
1542 1542
         CONFIG_ECHO_START;
1543
-        SERIAL_ECHOPAIR("  M200 T2 D", planner.filament_size[2]);
1543
+        SERIAL_ECHOPAIR("  M200 T2 D", LINEAR_UNIT(planner.filament_size[2]));
1544 1544
         SERIAL_EOL();
1545 1545
         #if EXTRUDERS > 3
1546 1546
           CONFIG_ECHO_START;
1547
-          SERIAL_ECHOPAIR("  M200 T3 D", planner.filament_size[3]);
1547
+          SERIAL_ECHOPAIR("  M200 T3 D", LINEAR_UNIT(planner.filament_size[3]));
1548 1548
           SERIAL_EOL();
1549 1549
           #if EXTRUDERS > 4
1550 1550
             CONFIG_ECHO_START;
1551
-            SERIAL_ECHOPAIR("  M200 T4 D", planner.filament_size[4]);
1551
+            SERIAL_ECHOPAIR("  M200 T4 D", LINEAR_UNIT(planner.filament_size[4]));
1552 1552
             SERIAL_EOL();
1553 1553
           #endif // EXTRUDERS > 4
1554 1554
         #endif // EXTRUDERS > 3

Loading…
Cancel
Save