Browse Source

Apply LINEAR_UNIT to M503 output for M200

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

+ 10
- 10
Marlin/configuration_store.cpp View File

1507
      */
1507
      */
1508
     CONFIG_ECHO_START;
1508
     CONFIG_ECHO_START;
1509
     #if ENABLED(INCH_MODE_SUPPORT)
1509
     #if ENABLED(INCH_MODE_SUPPORT)
1510
-      #define LINEAR_UNIT(N) ((N) / parser.linear_unit_factor)
1511
-      #define VOLUMETRIC_UNIT(N) ((N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1510
+      #define LINEAR_UNIT(N) (float(N) / parser.linear_unit_factor)
1511
+      #define VOLUMETRIC_UNIT(N) (float(N) / (parser.volumetric_enabled ? parser.volumetric_unit_factor : parser.linear_unit_factor))
1512
       SERIAL_ECHOPGM("  G2");
1512
       SERIAL_ECHOPGM("  G2");
1513
       SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0');
1513
       SERIAL_CHAR(parser.linear_unit_factor == 1.0 ? '1' : '0');
1514
       SERIAL_ECHOPGM(" ; Units in ");
1514
       SERIAL_ECHOPGM(" ; Units in ");
1515
       serialprintPGM(parser.linear_unit_factor == 1.0 ? PSTR("mm\n") : PSTR("inches\n"));
1515
       serialprintPGM(parser.linear_unit_factor == 1.0 ? PSTR("mm\n") : PSTR("inches\n"));
1516
     #else
1516
     #else
1517
-      #define LINEAR_UNIT(N) N
1518
-      #define VOLUMETRIC_UNIT(N) N
1517
+      #define LINEAR_UNIT(N) (N)
1518
+      #define VOLUMETRIC_UNIT(N) (N)
1519
       SERIAL_ECHOLNPGM("  G21    ; Units in mm");
1519
       SERIAL_ECHOLNPGM("  G21    ; Units in mm");
1520
     #endif
1520
     #endif
1521
 
1521
 
1531
         SERIAL_ECHOPGM(" ; Units in ");
1531
         SERIAL_ECHOPGM(" ; Units in ");
1532
         serialprintPGM(parser.temp_units_name());
1532
         serialprintPGM(parser.temp_units_name());
1533
       #else
1533
       #else
1534
-        #define TEMP_UNIT(N) N
1534
+        #define TEMP_UNIT(N) (N)
1535
         SERIAL_ECHOLNPGM("  M149 C ; Units in Celsius");
1535
         SERIAL_ECHOLNPGM("  M149 C ; Units in Celsius");
1536
       #endif
1536
       #endif
1537
 
1537
 
1552
     }
1552
     }
1553
 
1553
 
1554
     CONFIG_ECHO_START;
1554
     CONFIG_ECHO_START;
1555
-    SERIAL_ECHOPAIR("  M200 D", planner.filament_size[0]);
1555
+    SERIAL_ECHOPAIR("  M200 D", LINEAR_UNIT(planner.filament_size[0]));
1556
     SERIAL_EOL();
1556
     SERIAL_EOL();
1557
     #if EXTRUDERS > 1
1557
     #if EXTRUDERS > 1
1558
       CONFIG_ECHO_START;
1558
       CONFIG_ECHO_START;
1559
-      SERIAL_ECHOPAIR("  M200 T1 D", planner.filament_size[1]);
1559
+      SERIAL_ECHOPAIR("  M200 T1 D", LINEAR_UNIT(planner.filament_size[1]));
1560
       SERIAL_EOL();
1560
       SERIAL_EOL();
1561
       #if EXTRUDERS > 2
1561
       #if EXTRUDERS > 2
1562
         CONFIG_ECHO_START;
1562
         CONFIG_ECHO_START;
1563
-        SERIAL_ECHOPAIR("  M200 T2 D", planner.filament_size[2]);
1563
+        SERIAL_ECHOPAIR("  M200 T2 D", LINEAR_UNIT(planner.filament_size[2]));
1564
         SERIAL_EOL();
1564
         SERIAL_EOL();
1565
         #if EXTRUDERS > 3
1565
         #if EXTRUDERS > 3
1566
           CONFIG_ECHO_START;
1566
           CONFIG_ECHO_START;
1567
-          SERIAL_ECHOPAIR("  M200 T3 D", planner.filament_size[3]);
1567
+          SERIAL_ECHOPAIR("  M200 T3 D", LINEAR_UNIT(planner.filament_size[3]));
1568
           SERIAL_EOL();
1568
           SERIAL_EOL();
1569
           #if EXTRUDERS > 4
1569
           #if EXTRUDERS > 4
1570
             CONFIG_ECHO_START;
1570
             CONFIG_ECHO_START;
1571
-            SERIAL_ECHOPAIR("  M200 T4 D", planner.filament_size[4]);
1571
+            SERIAL_ECHOPAIR("  M200 T4 D", LINEAR_UNIT(planner.filament_size[4]));
1572
             SERIAL_EOL();
1572
             SERIAL_EOL();
1573
           #endif // EXTRUDERS > 4
1573
           #endif // EXTRUDERS > 4
1574
         #endif // EXTRUDERS > 3
1574
         #endif // EXTRUDERS > 3

Loading…
Cancel
Save