Browse Source

Followup for 6 extruders

pull/1/head
Scott Lahteine 6 years ago
parent
commit
53bd0b55cb
  1. 6
      Marlin/src/gcode/feature/trinamic/M911-M915.cpp
  2. 32
      Marlin/src/module/stepper_indirection.cpp

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

@ -131,8 +131,8 @@ void GcodeSuite::M912() {
#endif
#endif
#if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4)
const int8_t eval = int8_t(parser.byteval(axis_codes[E_AXIS], 0xFF));
#if M91x_USE_E(0) || M91x_USE_E(1) || M91x_USE_E(2) || M91x_USE_E(3) || M91x_USE_E(4) || M91x_USE_E(5)
const uint8_t eval = int8_t(parser.byteval(axis_codes[E_AXIS], 0xFF));
#if M91x_USE_E(0)
if (hasNone || eval == 0 || (hasE && eval < 0)) tmc_clear_otpw(stepperE0, TMC_E0);
#endif
@ -149,7 +149,7 @@ void GcodeSuite::M912() {
if (hasNone || eval == 4 || (hasE && eval < 0)) tmc_clear_otpw(stepperE4, TMC_E4);
#endif
#if M91x_USE_E(5)
if (hasNone || eval == 5 || (hasE && eval == 10)) tmc_clear_otpw(stepperE5, TMC_E5);
if (hasNone || eval == 5 || (hasE && eval < 0)) tmc_clear_otpw(stepperE5, TMC_E5);
#endif
#endif
}

32
Marlin/src/module/stepper_indirection.cpp

@ -87,6 +87,9 @@
#if AXIS_DRIVER_TYPE(E4, TMC26X)
_TMC26X_DEFINE(E4);
#endif
#if AXIS_DRIVER_TYPE(E5, TMC26X)
_TMC26X_DEFINE(E5);
#endif
#define _TMC26X_INIT(A) do{ \
stepper##A.setMicrosteps(A##_MICROSTEPS); \
@ -130,6 +133,9 @@
#if AXIS_DRIVER_TYPE(E4, TMC26X)
_TMC26X_INIT(E4);
#endif
#if AXIS_DRIVER_TYPE(E5, TMC26X)
_TMC26X_INIT(E5);
#endif
}
#endif // TMC26X
@ -190,6 +196,9 @@
#if AXIS_DRIVER_TYPE(E4, TMC2130)
_TMC2130_DEFINE(E4);
#endif
#if AXIS_DRIVER_TYPE(E5, TMC2130)
_TMC2130_DEFINE(E5);
#endif
// Use internal reference voltage for current calculations. This is the default.
// Following values from Trinamic's spreadsheet with values for a NEMA17 (42BYGHW609)
@ -394,6 +403,13 @@
_TMC2208_DEFINE_SOFTWARE(E4);
#endif
#endif
#if AXIS_DRIVER_TYPE(E5, TMC2208)
#ifdef E5_HARDWARE_SERIAL
_TMC2208_DEFINE_HARDWARE(E5);
#else
_TMC2208_DEFINE_SOFTWARE(E5);
#endif
#endif
void tmc2208_serial_begin() {
#if AXIS_DRIVER_TYPE(X, TMC2208)
@ -480,6 +496,13 @@
stepperE4.beginSerial(115200);
#endif
#endif
#if AXIS_DRIVER_TYPE(E5, TMC2208)
#ifdef E5_HARDWARE_SERIAL
E5_HARDWARE_SERIAL.begin(115200);
#else
stepperE5.beginSerial(115200);
#endif
#endif
}
// Use internal reference voltage for current calculations. This is the default.
@ -597,6 +620,9 @@ void restore_stepper_drivers() {
#if AXIS_IS_TMC(E4)
stepperE4.push();
#endif
#if AXIS_IS_TMC(E5)
stepperE5.push();
#endif
}
void reset_stepper_drivers() {
@ -667,6 +693,9 @@ void reset_stepper_drivers() {
#if AXIS_DRIVER_TYPE(E4, L6470)
_L6470_DEFINE(E4);
#endif
#if AXIS_DRIVER_TYPE(E5, L6470)
_L6470_DEFINE(E5);
#endif
#define _L6470_INIT(A) do{ \
stepper##A.init(); \
@ -713,6 +742,9 @@ void reset_stepper_drivers() {
#if AXIS_DRIVER_TYPE(E4, L6470)
_L6470_INIT(E4);
#endif
#if AXIS_DRIVER_TYPE(E5, L6470)
_L6470_INIT(E5);
#endif
}
#endif // L6470

Loading…
Cancel
Save