Browse Source

Tweaks to M915

Scott Lahteine 7 years ago
parent
commit
045ee28c50
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      Marlin/src/gcode/feature/trinamic/M911-M915.cpp

+ 4
- 4
Marlin/src/gcode/feature/trinamic/M911-M915.cpp View File

258
  */
258
  */
259
 #if ENABLED(TMC_Z_CALIBRATION)
259
 #if ENABLED(TMC_Z_CALIBRATION)
260
   void GcodeSuite::M915() {
260
   void GcodeSuite::M915() {
261
-    uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT;
262
-    uint16_t _z = parser.seenval('Z') ? parser.value_int() : CALIBRATION_EXTRA_HEIGHT;
261
+    const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT,
262
+                   _z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT;
263
 
263
 
264
     if (!axis_known_position[Z_AXIS]) {
264
     if (!axis_known_position[Z_AXIS]) {
265
       SERIAL_ECHOLNPGM("\nPlease home Z axis first");
265
       SERIAL_ECHOLNPGM("\nPlease home Z axis first");
267
     }
267
     }
268
 
268
 
269
     #if Z_IS_TRINAMIC
269
     #if Z_IS_TRINAMIC
270
-      uint16_t Z_current_1 = stepperZ.getCurrent();
270
+      const uint16_t Z_current_1 = stepperZ.getCurrent();
271
       stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
271
       stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
272
     #endif
272
     #endif
273
     #if Z2_IS_TRINAMIC
273
     #if Z2_IS_TRINAMIC
274
-      uint16_t Z2_current_1 = stepperZ2.getCurrent();
274
+      const uint16_t Z2_current_1 = stepperZ2.getCurrent();
275
       stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
275
       stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
276
     #endif
276
     #endif
277
 
277
 

Loading…
Cancel
Save