From 4685c7d59f4fd612c9756847ea3b6ce1712c1c15 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 13 Jul 2018 02:48:15 -0500 Subject: [PATCH] Followup to M91x I patch --- Marlin/src/gcode/feature/trinamic/M911-M915.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp index 3b4183e891..d7b971c97c 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M915.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M915.cpp @@ -163,26 +163,26 @@ void GcodeSuite::M912() { switch (i) { case X_AXIS: #if X_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(X,X); + if (index < 2) TMC_SET_PWMTHRS(X,X); #endif #if X2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(X,X2); + if (!(index & 1)) TMC_SET_PWMTHRS(X,X2); #endif break; case Y_AXIS: #if Y_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(Y,Y); + if (index < 2) TMC_SET_PWMTHRS(Y,Y); #endif #if Y2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(Y,Y2); + if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2); #endif break; case Z_AXIS: #if Z_IS_TRINAMIC - if (index == 0) TMC_SET_PWMTHRS(Z,Z); + if (index < 2) TMC_SET_PWMTHRS(Z,Z); #endif #if Z2_IS_TRINAMIC - if (index == 1) TMC_SET_PWMTHRS(Z,Z2); + if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2); #endif break; case E_AXIS: {