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)
void GcodeSuite::M915() {
uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT;
uint16_t _z = parser.seenval('Z') ? parser.value_int() : CALIBRATION_EXTRA_HEIGHT;
const uint16_t _rms = parser.seenval('S') ? parser.value_int() : CALIBRATION_CURRENT,
_z = parser.seenval('Z') ? parser.value_linear_units() : CALIBRATION_EXTRA_HEIGHT;
if (!axis_known_position[Z_AXIS]) {
SERIAL_ECHOLNPGM("\nPlease home Z axis first");
@ -267,11 +267,11 @@ void GcodeSuite::M912() {
}
#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);
#endif
#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);
#endif