Followup for 6 extruders

This commit is contained in:
Scott Lahteine 2018-09-16 23:57:50 -05:00
parent 722d186ca0
commit 53bd0b55cb
2 changed files with 35 additions and 3 deletions

View file

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

View file

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