Browse Source

Followup to M91x I patch

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

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

@@ -163,26 +163,26 @@ void GcodeSuite::M912() {
163 163
       switch (i) {
164 164
         case X_AXIS:
165 165
           #if X_IS_TRINAMIC
166
-            if (index == 0) TMC_SET_PWMTHRS(X,X);
166
+            if (index < 2) TMC_SET_PWMTHRS(X,X);
167 167
           #endif
168 168
           #if X2_IS_TRINAMIC
169
-            if (index == 1) TMC_SET_PWMTHRS(X,X2);
169
+            if (!(index & 1)) TMC_SET_PWMTHRS(X,X2);
170 170
           #endif
171 171
           break;
172 172
         case Y_AXIS:
173 173
           #if Y_IS_TRINAMIC
174
-            if (index == 0) TMC_SET_PWMTHRS(Y,Y);
174
+            if (index < 2) TMC_SET_PWMTHRS(Y,Y);
175 175
           #endif
176 176
           #if Y2_IS_TRINAMIC
177
-            if (index == 1) TMC_SET_PWMTHRS(Y,Y2);
177
+            if (!(index & 1)) TMC_SET_PWMTHRS(Y,Y2);
178 178
           #endif
179 179
           break;
180 180
         case Z_AXIS:
181 181
           #if Z_IS_TRINAMIC
182
-            if (index == 0) TMC_SET_PWMTHRS(Z,Z);
182
+            if (index < 2) TMC_SET_PWMTHRS(Z,Z);
183 183
           #endif
184 184
           #if Z2_IS_TRINAMIC
185
-            if (index == 1) TMC_SET_PWMTHRS(Z,Z2);
185
+            if (!(index & 1)) TMC_SET_PWMTHRS(Z,Z2);
186 186
           #endif
187 187
           break;
188 188
         case E_AXIS: {

Loading…
Cancel
Save