Browse Source

🐛 Fix "no T param" handling

Scott Lahteine 2 years ago
parent
commit
ff46d7cae2

+ 1
- 1
Marlin/src/gcode/feature/L6470/M906.cpp View File

285
 
285
 
286
       #if E_STEPPERS
286
       #if E_STEPPERS
287
         case E_AXIS: {
287
         case E_AXIS: {
288
-          const int8_t eindex = get_target_e_stepper_from_command();
288
+          const int8_t eindex = get_target_e_stepper_from_command(-2);
289
           #if AXIS_IS_L64XX(E0)
289
           #if AXIS_IS_L64XX(E0)
290
             if (eindex < 0 || eindex == 0) L6470_SET_KVAL_HOLD(E0);
290
             if (eindex < 0 || eindex == 0) L6470_SET_KVAL_HOLD(E0);
291
           #endif
291
           #endif

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M569.cpp View File

134
  */
134
  */
135
 void GcodeSuite::M569() {
135
 void GcodeSuite::M569() {
136
   if (parser.seen('S'))
136
   if (parser.seen('S'))
137
-    set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command());
137
+    set_stealth_status(parser.value_bool(), get_target_e_stepper_from_command(-2));
138
   else
138
   else
139
     say_stealth_status();
139
     say_stealth_status();
140
 }
140
 }

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M906.cpp View File

112
 
112
 
113
       #if E_STEPPERS
113
       #if E_STEPPERS
114
         case E_AXIS: {
114
         case E_AXIS: {
115
-          const int8_t eindex = get_target_e_stepper_from_command();
115
+          const int8_t eindex = get_target_e_stepper_from_command(-2);
116
           #if AXIS_IS_TMC(E0)
116
           #if AXIS_IS_TMC(E0)
117
             if (eindex < 0 || eindex == 0) TMC_SET_CURRENT(E0);
117
             if (eindex < 0 || eindex == 0) TMC_SET_CURRENT(E0);
118
           #endif
118
           #endif

+ 1
- 1
Marlin/src/gcode/feature/trinamic/M911-M914.cpp View File

291
           break;
291
           break;
292
         #if E_STEPPERS
292
         #if E_STEPPERS
293
           case E_AXIS: {
293
           case E_AXIS: {
294
-            const int8_t eindex = get_target_e_stepper_from_command();
294
+            const int8_t eindex = get_target_e_stepper_from_command(-2);
295
             TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_PWMTHRS_E(0));
295
             TERN_(E0_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 0) TMC_SET_PWMTHRS_E(0));
296
             TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_PWMTHRS_E(1));
296
             TERN_(E1_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 1) TMC_SET_PWMTHRS_E(1));
297
             TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_PWMTHRS_E(2));
297
             TERN_(E2_HAS_STEALTHCHOP, if (eindex < 0 || eindex == 2) TMC_SET_PWMTHRS_E(2));

+ 1
- 0
Marlin/src/gcode/gcode.cpp View File

148
 int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) {
148
 int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) {
149
   const int8_t e = parser.intval('T', dval);
149
   const int8_t e = parser.intval('T', dval);
150
   if (WITHIN(e, 0, E_STEPPERS - 1)) return e;
150
   if (WITHIN(e, 0, E_STEPPERS - 1)) return e;
151
+  if (dval == -2) return dval;
151
 
152
 
152
   SERIAL_ECHO_START();
153
   SERIAL_ECHO_START();
153
   SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);
154
   SERIAL_CHAR('M'); SERIAL_ECHO(parser.codenum);

Loading…
Cancel
Save