|
@@ -5933,7 +5933,7 @@ inline void gcode_M503() {
|
5933
|
5933
|
* M540: Set whether SD card print should abort on endstop hit (M540 S<0|1>)
|
5934
|
5934
|
*/
|
5935
|
5935
|
inline void gcode_M540() {
|
5936
|
|
- if (code_seen('S')) abort_on_endstop_hit = (code_value() > 0);
|
|
5936
|
+ if (code_seen('S')) stepper.abort_on_endstop_hit = (code_value() > 0);
|
5937
|
5937
|
}
|
5938
|
5938
|
|
5939
|
5939
|
#endif // ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
|
@@ -6166,18 +6166,18 @@ inline void gcode_M503() {
|
6166
|
6166
|
inline void gcode_M907() {
|
6167
|
6167
|
#if HAS_DIGIPOTSS
|
6168
|
6168
|
for (int i = 0; i < NUM_AXIS; i++)
|
6169
|
|
- if (code_seen(axis_codes[i])) digipot_current(i, code_value());
|
6170
|
|
- if (code_seen('B')) digipot_current(4, code_value());
|
6171
|
|
- if (code_seen('S')) for (int i = 0; i <= 4; i++) digipot_current(i, code_value());
|
|
6169
|
+ if (code_seen(axis_codes[i])) stepper.digipot_current(i, code_value());
|
|
6170
|
+ if (code_seen('B')) stepper.digipot_current(4, code_value());
|
|
6171
|
+ if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.digipot_current(i, code_value());
|
6172
|
6172
|
#endif
|
6173
|
6173
|
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
|
6174
|
|
- if (code_seen('X')) digipot_current(0, code_value());
|
|
6174
|
+ if (code_seen('X')) stepper.digipot_current(0, code_value());
|
6175
|
6175
|
#endif
|
6176
|
6176
|
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
|
6177
|
|
- if (code_seen('Z')) digipot_current(1, code_value());
|
|
6177
|
+ if (code_seen('Z')) stepper.digipot_current(1, code_value());
|
6178
|
6178
|
#endif
|
6179
|
6179
|
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
|
6180
|
|
- if (code_seen('E')) digipot_current(2, code_value());
|
|
6180
|
+ if (code_seen('E')) stepper.digipot_current(2, code_value());
|
6181
|
6181
|
#endif
|
6182
|
6182
|
#if ENABLED(DIGIPOT_I2C)
|
6183
|
6183
|
// this one uses actual amps in floating point
|
|
@@ -6201,7 +6201,7 @@ inline void gcode_M907() {
|
6201
|
6201
|
*/
|
6202
|
6202
|
inline void gcode_M908() {
|
6203
|
6203
|
#if HAS_DIGIPOTSS
|
6204
|
|
- digitalPotWrite(
|
|
6204
|
+ stepper.digitalPotWrite(
|
6205
|
6205
|
code_seen('P') ? code_value() : 0,
|
6206
|
6206
|
code_seen('S') ? code_value() : 0
|
6207
|
6207
|
);
|
|
@@ -6228,10 +6228,10 @@ inline void gcode_M907() {
|
6228
|
6228
|
|
6229
|
6229
|
// M350 Set microstepping mode. Warning: Steps per unit remains unchanged. S code sets stepping mode for all drivers.
|
6230
|
6230
|
inline void gcode_M350() {
|
6231
|
|
- if (code_seen('S')) for (int i = 0; i <= 4; i++) microstep_mode(i, code_value());
|
6232
|
|
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) microstep_mode(i, (uint8_t)code_value());
|
6233
|
|
- if (code_seen('B')) microstep_mode(4, code_value());
|
6234
|
|
- microstep_readings();
|
|
6231
|
+ if (code_seen('S')) for (int i = 0; i <= 4; i++) stepper.microstep_mode(i, code_value());
|
|
6232
|
+ for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_mode(i, (uint8_t)code_value());
|
|
6233
|
+ if (code_seen('B')) stepper.microstep_mode(4, code_value());
|
|
6234
|
+ stepper.microstep_readings();
|
6235
|
6235
|
}
|
6236
|
6236
|
|
6237
|
6237
|
/**
|
|
@@ -6241,15 +6241,15 @@ inline void gcode_M907() {
|
6241
|
6241
|
inline void gcode_M351() {
|
6242
|
6242
|
if (code_seen('S')) switch (code_value_short()) {
|
6243
|
6243
|
case 1:
|
6244
|
|
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) microstep_ms(i, code_value(), -1);
|
6245
|
|
- if (code_seen('B')) microstep_ms(4, code_value(), -1);
|
|
6244
|
+ for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, code_value(), -1);
|
|
6245
|
+ if (code_seen('B')) stepper.microstep_ms(4, code_value(), -1);
|
6246
|
6246
|
break;
|
6247
|
6247
|
case 2:
|
6248
|
|
- for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) microstep_ms(i, -1, code_value());
|
6249
|
|
- if (code_seen('B')) microstep_ms(4, -1, code_value());
|
|
6248
|
+ for (int i = 0; i < NUM_AXIS; i++) if (code_seen(axis_codes[i])) stepper.microstep_ms(i, -1, code_value());
|
|
6249
|
+ if (code_seen('B')) stepper.microstep_ms(4, -1, code_value());
|
6250
|
6250
|
break;
|
6251
|
6251
|
}
|
6252
|
|
- microstep_readings();
|
|
6252
|
+ stepper.microstep_readings();
|
6253
|
6253
|
}
|
6254
|
6254
|
|
6255
|
6255
|
#endif // HAS_MICROSTEPS
|