Tweaks to M915

This commit is contained in:
Scott Lahteine 2018-03-21 05:15:25 -05:00
parent 987597532c
commit 045ee28c50

View file

@ -258,8 +258,8 @@ void GcodeSuite::M912() {
*/ */
#if ENABLED(TMC_Z_CALIBRATION) #if ENABLED(TMC_Z_CALIBRATION)
void GcodeSuite::M915() { void GcodeSuite::M915() {
uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT; const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT,
uint16_t _z = parser.seenval('Z') ? parser.value_int() : CALIBRATION_EXTRA_HEIGHT; _z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT;
if (!axis_known_position[Z_AXIS]) { if (!axis_known_position[Z_AXIS]) {
SERIAL_ECHOLNPGM("\nPlease home Z axis first"); SERIAL_ECHOLNPGM("\nPlease home Z axis first");
@ -267,11 +267,11 @@ void GcodeSuite::M912() {
} }
#if Z_IS_TRINAMIC #if Z_IS_TRINAMIC
uint16_t Z_current_1 = stepperZ.getCurrent(); const uint16_t Z_current_1 = stepperZ.getCurrent();
stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); stepperZ.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
#endif #endif
#if Z2_IS_TRINAMIC #if Z2_IS_TRINAMIC
uint16_t Z2_current_1 = stepperZ2.getCurrent(); const uint16_t Z2_current_1 = stepperZ2.getCurrent();
stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER); stepperZ2.setCurrent(_rms, R_SENSE, HOLD_MULTIPLIER);
#endif #endif