Keep "astyled" elements in stepper_indirection.*

This commit is contained in:
Scott Lahteine
2015-10-02 23:14:19 -07:00
parent 38f626d7a2
commit 9cb7f3fafd
2 changed files with 415 additions and 417 deletions

View File

@@ -1,5 +1,5 @@
/* /*
stepper_indirection.c - stepper motor driver indirection stepper_indirection.c - stepper motor driver indirection
to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation to allow some stepper functions to be done via SPI/I2c instead of direct pin manipulation
Part of Marlin Part of Marlin
@@ -29,78 +29,77 @@
// Stepper objects of TMC steppers used // Stepper objects of TMC steppers used
#if ENABLED(X_IS_TMC) #if ENABLED(X_IS_TMC)
TMC26XStepper stepperX(200,X_ENABLE_PIN,X_STEP_PIN,X_DIR_PIN,X_MAX_CURRENT,X_SENSE_RESISTOR); TMC26XStepper stepperX(200, X_ENABLE_PIN, X_STEP_PIN, X_DIR_PIN, X_MAX_CURRENT, X_SENSE_RESISTOR);
#endif #endif
#if ENABLED(X2_IS_TMC) #if ENABLED(X2_IS_TMC)
TMC26XStepper stepperX2(200,X2_ENABLE_PIN,X2_STEP_PIN,X2_DIR_PIN,X2_MAX_CURRENT,X2_SENSE_RESISTOR); TMC26XStepper stepperX2(200, X2_ENABLE_PIN, X2_STEP_PIN, X2_DIR_PIN, X2_MAX_CURRENT, X2_SENSE_RESISTOR);
#endif #endif
#if ENABLED(Y_IS_TMC) #if ENABLED(Y_IS_TMC)
TMC26XStepper stepperY(200,Y_ENABLE_PIN,Y_STEP_PIN,Y_DIR_PIN,Y_MAX_CURRENT,Y_SENSE_RESISTOR); TMC26XStepper stepperY(200, Y_ENABLE_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_MAX_CURRENT, Y_SENSE_RESISTOR);
#endif #endif
#if ENABLED(Y2_IS_TMC) #if ENABLED(Y2_IS_TMC)
TMC26XStepper stepperY2(200,Y2_ENABLE_PIN,Y2_STEP_PIN,Y2_DIR_PIN,Y2_MAX_CURRENT,Y2_SENSE_RESISTOR); TMC26XStepper stepperY2(200, Y2_ENABLE_PIN, Y2_STEP_PIN, Y2_DIR_PIN, Y2_MAX_CURRENT, Y2_SENSE_RESISTOR);
#endif #endif
#if ENABLED(Z_IS_TMC) #if ENABLED(Z_IS_TMC)
TMC26XStepper stepperZ(200,Z_ENABLE_PIN,Z_STEP_PIN,Z_DIR_PIN,Z_MAX_CURRENT,Z_SENSE_RESISTOR); TMC26XStepper stepperZ(200, Z_ENABLE_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_MAX_CURRENT, Z_SENSE_RESISTOR);
#endif #endif
#if ENABLED(Z2_IS_TMC) #if ENABLED(Z2_IS_TMC)
TMC26XStepper stepperZ2(200,Z2_ENABLE_PIN,Z2_STEP_PIN,Z2_DIR_PIN,Z2_MAX_CURRENT,Z2_SENSE_RESISTOR); TMC26XStepper stepperZ2(200, Z2_ENABLE_PIN, Z2_STEP_PIN, Z2_DIR_PIN, Z2_MAX_CURRENT, Z2_SENSE_RESISTOR);
#endif #endif
#if ENABLED(E0_IS_TMC) #if ENABLED(E0_IS_TMC)
TMC26XStepper stepperE0(200,E0_ENABLE_PIN,E0_STEP_PIN,E0_DIR_PIN,E0_MAX_CURRENT,E0_SENSE_RESISTOR); TMC26XStepper stepperE0(200, E0_ENABLE_PIN, E0_STEP_PIN, E0_DIR_PIN, E0_MAX_CURRENT, E0_SENSE_RESISTOR);
#endif #endif
#if ENABLED(E1_IS_TMC) #if ENABLED(E1_IS_TMC)
TMC26XStepper stepperE1(200,E1_ENABLE_PIN,E1_STEP_PIN,E1_DIR_PIN,E1_MAX_CURRENT,E1_SENSE_RESISTOR); TMC26XStepper stepperE1(200, E1_ENABLE_PIN, E1_STEP_PIN, E1_DIR_PIN, E1_MAX_CURRENT, E1_SENSE_RESISTOR);
#endif #endif
#if ENABLED(E2_IS_TMC) #if ENABLED(E2_IS_TMC)
TMC26XStepper stepperE2(200,E2_ENABLE_PIN,E2_STEP_PIN,E2_DIR_PIN,E2_MAX_CURRENT,E2_SENSE_RESISTOR); TMC26XStepper stepperE2(200, E2_ENABLE_PIN, E2_STEP_PIN, E2_DIR_PIN, E2_MAX_CURRENT, E2_SENSE_RESISTOR);
#endif #endif
#if ENABLED(E3_IS_TMC) #if ENABLED(E3_IS_TMC)
TMC26XStepper stepperE3(200,E3_ENABLE_PIN,E3_STEP_PIN,E3_DIR_PIN,E3_MAX_CURRENT,E3_SENSE_RESISTOR); TMC26XStepper stepperE3(200, E3_ENABLE_PIN, E3_STEP_PIN, E3_DIR_PIN, E3_MAX_CURRENT, E3_SENSE_RESISTOR);
#endif #endif
#if ENABLED(HAVE_TMCDRIVER) #if ENABLED(HAVE_TMCDRIVER)
void tmc_init() void tmc_init() {
{
#if ENABLED(X_IS_TMC) #if ENABLED(X_IS_TMC)
stepperX.setMicrosteps(X_MICROSTEPS); stepperX.setMicrosteps(X_MICROSTEPS);
stepperX.start(); stepperX.start();
#endif #endif
#if ENABLED(X2_IS_TMC) #if ENABLED(X2_IS_TMC)
stepperX2.setMicrosteps(X2_MICROSTEPS); stepperX2.setMicrosteps(X2_MICROSTEPS);
stepperX2.start(); stepperX2.start();
#endif #endif
#if ENABLED(Y_IS_TMC) #if ENABLED(Y_IS_TMC)
stepperY.setMicrosteps(Y_MICROSTEPS); stepperY.setMicrosteps(Y_MICROSTEPS);
stepperY.start(); stepperY.start();
#endif #endif
#if ENABLED(Y2_IS_TMC) #if ENABLED(Y2_IS_TMC)
stepperY2.setMicrosteps(Y2_MICROSTEPS); stepperY2.setMicrosteps(Y2_MICROSTEPS);
stepperY2.start(); stepperY2.start();
#endif #endif
#if ENABLED(Z_IS_TMC) #if ENABLED(Z_IS_TMC)
stepperZ.setMicrosteps(Z_MICROSTEPS); stepperZ.setMicrosteps(Z_MICROSTEPS);
stepperZ.start(); stepperZ.start();
#endif #endif
#if ENABLED(Z2_IS_TMC) #if ENABLED(Z2_IS_TMC)
stepperZ2.setMicrosteps(Z2_MICROSTEPS); stepperZ2.setMicrosteps(Z2_MICROSTEPS);
stepperZ2.start(); stepperZ2.start();
#endif #endif
#if ENABLED(E0_IS_TMC) #if ENABLED(E0_IS_TMC)
stepperE0.setMicrosteps(E0_MICROSTEPS); stepperE0.setMicrosteps(E0_MICROSTEPS);
stepperE0.start(); stepperE0.start();
#endif #endif
#if ENABLED(E1_IS_TMC) #if ENABLED(E1_IS_TMC)
stepperE1.setMicrosteps(E1_MICROSTEPS); stepperE1.setMicrosteps(E1_MICROSTEPS);
stepperE1.start(); stepperE1.start();
#endif #endif
#if ENABLED(E2_IS_TMC) #if ENABLED(E2_IS_TMC)
stepperE2.setMicrosteps(E2_MICROSTEPS); stepperE2.setMicrosteps(E2_MICROSTEPS);
stepperE2.start(); stepperE2.start();
#endif #endif
#if ENABLED(E3_IS_TMC) #if ENABLED(E3_IS_TMC)
stepperE3.setMicrosteps(E3_MICROSTEPS); stepperE3.setMicrosteps(E3_MICROSTEPS);
stepperE3.start(); stepperE3.start();
#endif #endif
} }
#endif #endif
@@ -108,117 +107,116 @@ void tmc_init()
// L6470 Driver objects and inits // L6470 Driver objects and inits
#if ENABLED(HAVE_L6470DRIVER) #if ENABLED(HAVE_L6470DRIVER)
#include <SPI.h> #include <SPI.h>
#include <L6470.h> #include <L6470.h>
#endif #endif
// L6470 Stepper objects // L6470 Stepper objects
#if ENABLED(X_IS_L6470) #if ENABLED(X_IS_L6470)
L6470 stepperX(X_ENABLE_PIN); L6470 stepperX(X_ENABLE_PIN);
#endif #endif
#if ENABLED(X2_IS_L6470) #if ENABLED(X2_IS_L6470)
L6470 stepperX2(X2_ENABLE_PIN); L6470 stepperX2(X2_ENABLE_PIN);
#endif #endif
#if ENABLED(Y_IS_L6470) #if ENABLED(Y_IS_L6470)
L6470 stepperY(Y_ENABLE_PIN); L6470 stepperY(Y_ENABLE_PIN);
#endif #endif
#if ENABLED(Y2_IS_L6470) #if ENABLED(Y2_IS_L6470)
L6470 stepperY2(Y2_ENABLE_PIN); L6470 stepperY2(Y2_ENABLE_PIN);
#endif #endif
#if ENABLED(Z_IS_L6470) #if ENABLED(Z_IS_L6470)
L6470 stepperZ(Z_ENABLE_PIN); L6470 stepperZ(Z_ENABLE_PIN);
#endif #endif
#if ENABLED(Z2_IS_L6470) #if ENABLED(Z2_IS_L6470)
L6470 stepperZ2(Z2_ENABLE_PIN); L6470 stepperZ2(Z2_ENABLE_PIN);
#endif #endif
#if ENABLED(E0_IS_L6470) #if ENABLED(E0_IS_L6470)
L6470 stepperE0(E0_ENABLE_PIN); L6470 stepperE0(E0_ENABLE_PIN);
#endif #endif
#if ENABLED(E1_IS_L6470) #if ENABLED(E1_IS_L6470)
L6470 stepperE1(E1_ENABLE_PIN); L6470 stepperE1(E1_ENABLE_PIN);
#endif #endif
#if ENABLED(E2_IS_L6470) #if ENABLED(E2_IS_L6470)
L6470 stepperE2(E2_ENABLE_PIN); L6470 stepperE2(E2_ENABLE_PIN);
#endif #endif
#if ENABLED(E3_IS_L6470) #if ENABLED(E3_IS_L6470)
L6470 stepperE3(E3_ENABLE_PIN); L6470 stepperE3(E3_ENABLE_PIN);
#endif #endif
// init routine // init routine
#if ENABLED(HAVE_L6470DRIVER) #if ENABLED(HAVE_L6470DRIVER)
void L6470_init() void L6470_init() {
{
#if ENABLED(X_IS_L6470) #if ENABLED(X_IS_L6470)
stepperX.init(X_K_VAL); stepperX.init(X_K_VAL);
stepperX.softFree(); stepperX.softFree();
stepperX.setMicroSteps(X_MICROSTEPS); stepperX.setMicroSteps(X_MICROSTEPS);
stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection stepperX.setOverCurrent(X_OVERCURRENT); //set overcurrent protection
stepperX.setStallCurrent(X_STALLCURRENT); stepperX.setStallCurrent(X_STALLCURRENT);
#endif #endif
#if ENABLED(X2_IS_L6470) #if ENABLED(X2_IS_L6470)
stepperX2.init(X2_K_VAL); stepperX2.init(X2_K_VAL);
stepperX2.softFree(); stepperX2.softFree();
stepperX2.setMicroSteps(X2_MICROSTEPS); stepperX2.setMicroSteps(X2_MICROSTEPS);
stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection stepperX2.setOverCurrent(X2_OVERCURRENT); //set overcurrent protection
stepperX2.setStallCurrent(X2_STALLCURRENT); stepperX2.setStallCurrent(X2_STALLCURRENT);
#endif #endif
#if ENABLED(Y_IS_L6470) #if ENABLED(Y_IS_L6470)
stepperY.init(Y_K_VAL); stepperY.init(Y_K_VAL);
stepperY.softFree(); stepperY.softFree();
stepperY.setMicroSteps(Y_MICROSTEPS); stepperY.setMicroSteps(Y_MICROSTEPS);
stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection stepperY.setOverCurrent(Y_OVERCURRENT); //set overcurrent protection
stepperY.setStallCurrent(Y_STALLCURRENT); stepperY.setStallCurrent(Y_STALLCURRENT);
#endif #endif
#if ENABLED(Y2_IS_L6470) #if ENABLED(Y2_IS_L6470)
stepperY2.init(Y2_K_VAL); stepperY2.init(Y2_K_VAL);
stepperY2.softFree(); stepperY2.softFree();
stepperY2.setMicroSteps(Y2_MICROSTEPS); stepperY2.setMicroSteps(Y2_MICROSTEPS);
stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection stepperY2.setOverCurrent(Y2_OVERCURRENT); //set overcurrent protection
stepperY2.setStallCurrent(Y2_STALLCURRENT); stepperY2.setStallCurrent(Y2_STALLCURRENT);
#endif #endif
#if ENABLED(Z_IS_L6470) #if ENABLED(Z_IS_L6470)
stepperZ.init(Z_K_VAL); stepperZ.init(Z_K_VAL);
stepperZ.softFree(); stepperZ.softFree();
stepperZ.setMicroSteps(Z_MICROSTEPS); stepperZ.setMicroSteps(Z_MICROSTEPS);
stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection stepperZ.setOverCurrent(Z_OVERCURRENT); //set overcurrent protection
stepperZ.setStallCurrent(Z_STALLCURRENT); stepperZ.setStallCurrent(Z_STALLCURRENT);
#endif #endif
#if ENABLED(Z2_IS_L6470) #if ENABLED(Z2_IS_L6470)
stepperZ2.init(Z2_K_VAL); stepperZ2.init(Z2_K_VAL);
stepperZ2.softFree(); stepperZ2.softFree();
stepperZ2.setMicroSteps(Z2_MICROSTEPS); stepperZ2.setMicroSteps(Z2_MICROSTEPS);
stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection stepperZ2.setOverCurrent(Z2_OVERCURRENT); //set overcurrent protection
stepperZ2.setStallCurrent(Z2_STALLCURRENT); stepperZ2.setStallCurrent(Z2_STALLCURRENT);
#endif #endif
#if ENABLED(E0_IS_L6470) #if ENABLED(E0_IS_L6470)
stepperE0.init(E0_K_VAL); stepperE0.init(E0_K_VAL);
stepperE0.softFree(); stepperE0.softFree();
stepperE0.setMicroSteps(E0_MICROSTEPS); stepperE0.setMicroSteps(E0_MICROSTEPS);
stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection stepperE0.setOverCurrent(E0_OVERCURRENT); //set overcurrent protection
stepperE0.setStallCurrent(E0_STALLCURRENT); stepperE0.setStallCurrent(E0_STALLCURRENT);
#endif #endif
#if ENABLED(E1_IS_L6470) #if ENABLED(E1_IS_L6470)
stepperE1.init(E1_K_VAL); stepperE1.init(E1_K_VAL);
stepperE1.softFree(); stepperE1.softFree();
stepperE1.setMicroSteps(E1_MICROSTEPS); stepperE1.setMicroSteps(E1_MICROSTEPS);
stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection stepperE1.setOverCurrent(E1_OVERCURRENT); //set overcurrent protection
stepperE1.setStallCurrent(E1_STALLCURRENT); stepperE1.setStallCurrent(E1_STALLCURRENT);
#endif #endif
#if ENABLED(E2_IS_L6470) #if ENABLED(E2_IS_L6470)
stepperE2.init(E2_K_VAL); stepperE2.init(E2_K_VAL);
stepperE2.softFree(); stepperE2.softFree();
stepperE2.setMicroSteps(E2_MICROSTEPS); stepperE2.setMicroSteps(E2_MICROSTEPS);
stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection stepperE2.setOverCurrent(E2_OVERCURRENT); //set overcurrent protection
stepperE2.setStallCurrent(E2_STALLCURRENT); stepperE2.setStallCurrent(E2_STALLCURRENT);
#endif #endif
#if ENABLED(E3_IS_L6470) #if ENABLED(E3_IS_L6470)
stepperE3.init(E3_K_VAL); stepperE3.init(E3_K_VAL);
stepperE3.softFree(); stepperE3.softFree();
stepperE3.setMicroSteps(E3_MICROSTEPS); stepperE3.setMicroSteps(E3_MICROSTEPS);
stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection stepperE3.setOverCurrent(E3_OVERCURRENT); //set overcurrent protection
stepperE3.setStallCurrent(E3_STALLCURRENT); stepperE3.setStallCurrent(E3_STALLCURRENT);
#endif #endif
} }
#endif #endif

View File

@@ -155,339 +155,339 @@
#define E3_ENABLE_READ READ(E3_ENABLE_PIN) #define E3_ENABLE_READ READ(E3_ENABLE_PIN)
////////////////////////////////// //////////////////////////////////
// Pin redefines for TMC drivers. // Pin redefines for TMC drivers.
// TMC26X drivers have step and dir on normal pins, but everything else via SPI // TMC26X drivers have step and dir on normal pins, but everything else via SPI
////////////////////////////////// //////////////////////////////////
#if ENABLED(HAVE_TMCDRIVER) #if ENABLED(HAVE_TMCDRIVER)
#include <SPI.h> #include <SPI.h>
#include <TMC26XStepper.h> #include <TMC26XStepper.h>
void tmc_init(); void tmc_init();
#if ENABLED(X_IS_TMC) #if ENABLED(X_IS_TMC)
extern TMC26XStepper stepperX; extern TMC26XStepper stepperX;
#undef X_ENABLE_INIT #undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0) #define X_ENABLE_INIT ((void)0)
#undef X_ENABLE_WRITE #undef X_ENABLE_WRITE
#define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE) #define X_ENABLE_WRITE(STATE) stepperX.setEnabled(STATE)
#undef X_ENABLE_READ #undef X_ENABLE_READ
#define X_ENABLE_READ stepperX.isEnabled() #define X_ENABLE_READ stepperX.isEnabled()
#endif #endif
#if ENABLED(X2_IS_TMC) #if ENABLED(X2_IS_TMC)
extern TMC26XStepper stepperX2; extern TMC26XStepper stepperX2;
#undef X2_ENABLE_INIT #undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0) #define X2_ENABLE_INIT ((void)0)
#undef X2_ENABLE_WRITE #undef X2_ENABLE_WRITE
#define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE) #define X2_ENABLE_WRITE(STATE) stepperX2.setEnabled(STATE)
#undef X2_ENABLE_READ #undef X2_ENABLE_READ
#define X2_ENABLE_READ stepperX2.isEnabled() #define X2_ENABLE_READ stepperX2.isEnabled()
#endif #endif
#if ENABLED(Y_IS_TMC) #if ENABLED(Y_IS_TMC)
extern TMC26XStepper stepperY; extern TMC26XStepper stepperY;
#undef Y_ENABLE_INIT #undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0) #define Y_ENABLE_INIT ((void)0)
#undef Y_ENABLE_WRITE #undef Y_ENABLE_WRITE
#define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE) #define Y_ENABLE_WRITE(STATE) stepperY.setEnabled(STATE)
#undef Y_ENABLE_READ #undef Y_ENABLE_READ
#define Y_ENABLE_READ stepperY.isEnabled() #define Y_ENABLE_READ stepperY.isEnabled()
#endif #endif
#if ENABLED(Y2_IS_TMC) #if ENABLED(Y2_IS_TMC)
extern TMC26XStepper stepperY2; extern TMC26XStepper stepperY2;
#undef Y2_ENABLE_INIT #undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0) #define Y2_ENABLE_INIT ((void)0)
#undef Y2_ENABLE_WRITE #undef Y2_ENABLE_WRITE
#define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE) #define Y2_ENABLE_WRITE(STATE) stepperY2.setEnabled(STATE)
#undef Y2_ENABLE_READ #undef Y2_ENABLE_READ
#define Y2_ENABLE_READ stepperY2.isEnabled() #define Y2_ENABLE_READ stepperY2.isEnabled()
#endif #endif
#if ENABLED(Z_IS_TMC) #if ENABLED(Z_IS_TMC)
extern TMC26XStepper stepperZ; extern TMC26XStepper stepperZ;
#undef Z_ENABLE_INIT #undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0) #define Z_ENABLE_INIT ((void)0)
#undef Z_ENABLE_WRITE #undef Z_ENABLE_WRITE
#define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE) #define Z_ENABLE_WRITE(STATE) stepperZ.setEnabled(STATE)
#undef Z_ENABLE_READ #undef Z_ENABLE_READ
#define Z_ENABLE_READ stepperZ.isEnabled() #define Z_ENABLE_READ stepperZ.isEnabled()
#endif #endif
#if ENABLED(Z2_IS_TMC) #if ENABLED(Z2_IS_TMC)
extern TMC26XStepper stepperZ2; extern TMC26XStepper stepperZ2;
#undef Z2_ENABLE_INIT #undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0) #define Z2_ENABLE_INIT ((void)0)
#undef Z2_ENABLE_WRITE #undef Z2_ENABLE_WRITE
#define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE) #define Z2_ENABLE_WRITE(STATE) stepperZ2.setEnabled(STATE)
#undef Z2_ENABLE_READ #undef Z2_ENABLE_READ
#define Z2_ENABLE_READ stepperZ2.isEnabled() #define Z2_ENABLE_READ stepperZ2.isEnabled()
#endif #endif
#if ENABLED(E0_IS_TMC) #if ENABLED(E0_IS_TMC)
extern TMC26XStepper stepperE0; extern TMC26XStepper stepperE0;
#undef E0_ENABLE_INIT #undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0) #define E0_ENABLE_INIT ((void)0)
#undef E0_ENABLE_WRITE #undef E0_ENABLE_WRITE
#define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE) #define E0_ENABLE_WRITE(STATE) stepperE0.setEnabled(STATE)
#undef E0_ENABLE_READ #undef E0_ENABLE_READ
#define E0_ENABLE_READ stepperE0.isEnabled() #define E0_ENABLE_READ stepperE0.isEnabled()
#endif #endif
#if ENABLED(E1_IS_TMC) #if ENABLED(E1_IS_TMC)
extern TMC26XStepper stepperE1; extern TMC26XStepper stepperE1;
#undef E1_ENABLE_INIT #undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0) #define E1_ENABLE_INIT ((void)0)
#undef E1_ENABLE_WRITE #undef E1_ENABLE_WRITE
#define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE) #define E1_ENABLE_WRITE(STATE) stepperE1.setEnabled(STATE)
#undef E1_ENABLE_READ #undef E1_ENABLE_READ
#define E1_ENABLE_READ stepperE1.isEnabled() #define E1_ENABLE_READ stepperE1.isEnabled()
#endif #endif
#if ENABLED(E2_IS_TMC) #if ENABLED(E2_IS_TMC)
extern TMC26XStepper stepperE2; extern TMC26XStepper stepperE2;
#undef E2_ENABLE_INIT #undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0) #define E2_ENABLE_INIT ((void)0)
#undef E2_ENABLE_WRITE #undef E2_ENABLE_WRITE
#define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE) #define E2_ENABLE_WRITE(STATE) stepperE2.setEnabled(STATE)
#undef E2_ENABLE_READ #undef E2_ENABLE_READ
#define E2_ENABLE_READ stepperE2.isEnabled() #define E2_ENABLE_READ stepperE2.isEnabled()
#endif #endif
#if ENABLED(E3_IS_TMC) #if ENABLED(E3_IS_TMC)
extern TMC26XStepper stepperE3; extern TMC26XStepper stepperE3;
#undef E3_ENABLE_INIT #undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0) #define E3_ENABLE_INIT ((void)0)
#undef E3_ENABLE_WRITE #undef E3_ENABLE_WRITE
#define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE) #define E3_ENABLE_WRITE(STATE) stepperE3.setEnabled(STATE)
#undef E3_ENABLE_READ #undef E3_ENABLE_READ
#define E3_ENABLE_READ stepperE3.isEnabled() #define E3_ENABLE_READ stepperE3.isEnabled()
#endif #endif
#endif // HAVE_TMCDRIVER #endif // HAVE_TMCDRIVER
////////////////////////////////// //////////////////////////////////
// Pin redefines for L6470 drivers. // Pin redefines for L6470 drivers.
// L640 drivers have step on normal pins, but dir and everything else via SPI // L640 drivers have step on normal pins, but dir and everything else via SPI
////////////////////////////////// //////////////////////////////////
#if ENABLED(HAVE_L6470DRIVER) #if ENABLED(HAVE_L6470DRIVER)
#include <SPI.h> #include <SPI.h>
#include <L6470.h> #include <L6470.h>
void L6470_init(); void L6470_init();
#if ENABLED(X_IS_L6470) #if ENABLED(X_IS_L6470)
extern L6470 stepperX; extern L6470 stepperX;
#undef X_ENABLE_INIT #undef X_ENABLE_INIT
#define X_ENABLE_INIT ((void)0) #define X_ENABLE_INIT ((void)0)
#undef X_ENABLE_WRITE #undef X_ENABLE_WRITE
#define X_ENABLE_WRITE(STATE) {if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();} #define X_ENABLE_WRITE(STATE) {if(STATE) stepperX.Step_Clock(stepperX.getStatus() & STATUS_HIZ); else stepperX.softFree();}
#undef X_ENABLE_READ #undef X_ENABLE_READ
#define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ) #define X_ENABLE_READ (stepperX.getStatus() & STATUS_HIZ)
#undef X_DIR_INIT #undef X_DIR_INIT
#define X_DIR_INIT ((void)0) #define X_DIR_INIT ((void)0)
#undef X_DIR_WRITE #undef X_DIR_WRITE
#define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE) #define X_DIR_WRITE(STATE) stepperX.Step_Clock(STATE)
#undef X_DIR_READ #undef X_DIR_READ
#define X_DIR_READ (stepperX.getStatus() & STATUS_DIR) #define X_DIR_READ (stepperX.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(X2_IS_L6470) #if ENABLED(X2_IS_L6470)
extern L6470 stepperX2; extern L6470 stepperX2;
#undef X2_ENABLE_INIT #undef X2_ENABLE_INIT
#define X2_ENABLE_INIT ((void)0) #define X2_ENABLE_INIT ((void)0)
#undef X2_ENABLE_WRITE #undef X2_ENABLE_WRITE
#define X2_ENABLE_WRITE(STATE) (if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();) #define X2_ENABLE_WRITE(STATE) (if(STATE) stepperX2.Step_Clock(stepperX2.getStatus() & STATUS_HIZ); else stepperX2.softFree();)
#undef X2_ENABLE_READ #undef X2_ENABLE_READ
#define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ) #define X2_ENABLE_READ (stepperX2.getStatus() & STATUS_HIZ)
#undef X2_DIR_INIT #undef X2_DIR_INIT
#define X2_DIR_INIT ((void)0) #define X2_DIR_INIT ((void)0)
#undef X2_DIR_WRITE #undef X2_DIR_WRITE
#define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE) #define X2_DIR_WRITE(STATE) stepperX2.Step_Clock(STATE)
#undef X2_DIR_READ #undef X2_DIR_READ
#define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR) #define X2_DIR_READ (stepperX2.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(Y_IS_L6470) #if ENABLED(Y_IS_L6470)
extern L6470 stepperY; extern L6470 stepperY;
#undef Y_ENABLE_INIT #undef Y_ENABLE_INIT
#define Y_ENABLE_INIT ((void)0) #define Y_ENABLE_INIT ((void)0)
#undef Y_ENABLE_WRITE #undef Y_ENABLE_WRITE
#define Y_ENABLE_WRITE(STATE) (if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();) #define Y_ENABLE_WRITE(STATE) (if(STATE) stepperY.Step_Clock(stepperY.getStatus() & STATUS_HIZ); else stepperY.softFree();)
#undef Y_ENABLE_READ #undef Y_ENABLE_READ
#define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ) #define Y_ENABLE_READ (stepperY.getStatus() & STATUS_HIZ)
#undef Y_DIR_INIT #undef Y_DIR_INIT
#define Y_DIR_INIT ((void)0) #define Y_DIR_INIT ((void)0)
#undef Y_DIR_WRITE #undef Y_DIR_WRITE
#define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE) #define Y_DIR_WRITE(STATE) stepperY.Step_Clock(STATE)
#undef Y_DIR_READ #undef Y_DIR_READ
#define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR) #define Y_DIR_READ (stepperY.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(Y2_IS_L6470) #if ENABLED(Y2_IS_L6470)
extern L6470 stepperY2; extern L6470 stepperY2;
#undef Y2_ENABLE_INIT #undef Y2_ENABLE_INIT
#define Y2_ENABLE_INIT ((void)0) #define Y2_ENABLE_INIT ((void)0)
#undef Y2_ENABLE_WRITE #undef Y2_ENABLE_WRITE
#define Y2_ENABLE_WRITE(STATE) (if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();) #define Y2_ENABLE_WRITE(STATE) (if(STATE) stepperY2.Step_Clock(stepperY2.getStatus() & STATUS_HIZ); else stepperY2.softFree();)
#undef Y2_ENABLE_READ #undef Y2_ENABLE_READ
#define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ) #define Y2_ENABLE_READ (stepperY2.getStatus() & STATUS_HIZ)
#undef Y2_DIR_INIT #undef Y2_DIR_INIT
#define Y2_DIR_INIT ((void)0) #define Y2_DIR_INIT ((void)0)
#undef Y2_DIR_WRITE #undef Y2_DIR_WRITE
#define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE) #define Y2_DIR_WRITE(STATE) stepperY2.Step_Clock(STATE)
#undef Y2_DIR_READ #undef Y2_DIR_READ
#define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR) #define Y2_DIR_READ (stepperY2.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(Z_IS_L6470) #if ENABLED(Z_IS_L6470)
extern L6470 stepperZ; extern L6470 stepperZ;
#undef Z_ENABLE_INIT #undef Z_ENABLE_INIT
#define Z_ENABLE_INIT ((void)0) #define Z_ENABLE_INIT ((void)0)
#undef Z_ENABLE_WRITE #undef Z_ENABLE_WRITE
#define Z_ENABLE_WRITE(STATE) (if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();) #define Z_ENABLE_WRITE(STATE) (if(STATE) stepperZ.Step_Clock(stepperZ.getStatus() & STATUS_HIZ); else stepperZ.softFree();)
#undef Z_ENABLE_READ #undef Z_ENABLE_READ
#define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ) #define Z_ENABLE_READ (stepperZ.getStatus() & STATUS_HIZ)
#undef Z_DIR_INIT #undef Z_DIR_INIT
#define Z_DIR_INIT ((void)0) #define Z_DIR_INIT ((void)0)
#undef Z_DIR_WRITE #undef Z_DIR_WRITE
#define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE) #define Z_DIR_WRITE(STATE) stepperZ.Step_Clock(STATE)
#undef Y_DIR_READ #undef Y_DIR_READ
#define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR) #define Y_DIR_READ (stepperZ.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(Z2_IS_L6470) #if ENABLED(Z2_IS_L6470)
extern L6470 stepperZ2; extern L6470 stepperZ2;
#undef Z2_ENABLE_INIT #undef Z2_ENABLE_INIT
#define Z2_ENABLE_INIT ((void)0) #define Z2_ENABLE_INIT ((void)0)
#undef Z2_ENABLE_WRITE #undef Z2_ENABLE_WRITE
#define Z2_ENABLE_WRITE(STATE) (if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();) #define Z2_ENABLE_WRITE(STATE) (if(STATE) stepperZ2.Step_Clock(stepperZ2.getStatus() & STATUS_HIZ); else stepperZ2.softFree();)
#undef Z2_ENABLE_READ #undef Z2_ENABLE_READ
#define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ) #define Z2_ENABLE_READ (stepperZ2.getStatus() & STATUS_HIZ)
#undef Z2_DIR_INIT #undef Z2_DIR_INIT
#define Z2_DIR_INIT ((void)0) #define Z2_DIR_INIT ((void)0)
#undef Z2_DIR_WRITE #undef Z2_DIR_WRITE
#define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE) #define Z2_DIR_WRITE(STATE) stepperZ2.Step_Clock(STATE)
#undef Y2_DIR_READ #undef Y2_DIR_READ
#define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR) #define Y2_DIR_READ (stepperZ2.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(E0_IS_L6470) #if ENABLED(E0_IS_L6470)
extern L6470 stepperE0; extern L6470 stepperE0;
#undef E0_ENABLE_INIT #undef E0_ENABLE_INIT
#define E0_ENABLE_INIT ((void)0) #define E0_ENABLE_INIT ((void)0)
#undef E0_ENABLE_WRITE #undef E0_ENABLE_WRITE
#define E0_ENABLE_WRITE(STATE) (if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();) #define E0_ENABLE_WRITE(STATE) (if(STATE) stepperE0.Step_Clock(stepperE0.getStatus() & STATUS_HIZ); else stepperE0.softFree();)
#undef E0_ENABLE_READ #undef E0_ENABLE_READ
#define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ) #define E0_ENABLE_READ (stepperE0.getStatus() & STATUS_HIZ)
#undef E0_DIR_INIT #undef E0_DIR_INIT
#define E0_DIR_INIT ((void)0) #define E0_DIR_INIT ((void)0)
#undef E0_DIR_WRITE #undef E0_DIR_WRITE
#define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE) #define E0_DIR_WRITE(STATE) stepperE0.Step_Clock(STATE)
#undef E0_DIR_READ #undef E0_DIR_READ
#define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR) #define E0_DIR_READ (stepperE0.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(E1_IS_L6470) #if ENABLED(E1_IS_L6470)
extern L6470 stepperE1; extern L6470 stepperE1;
#undef E1_ENABLE_INIT #undef E1_ENABLE_INIT
#define E1_ENABLE_INIT ((void)0) #define E1_ENABLE_INIT ((void)0)
#undef E1_ENABLE_WRITE #undef E1_ENABLE_WRITE
#define E1_ENABLE_WRITE(STATE) (if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();) #define E1_ENABLE_WRITE(STATE) (if(STATE) stepperE1.Step_Clock(stepperE1.getStatus() & STATUS_HIZ); else stepperE1.softFree();)
#undef E1_ENABLE_READ #undef E1_ENABLE_READ
#define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ) #define E1_ENABLE_READ (stepperE1.getStatus() & STATUS_HIZ)
#undef E1_DIR_INIT #undef E1_DIR_INIT
#define E1_DIR_INIT ((void)0) #define E1_DIR_INIT ((void)0)
#undef E1_DIR_WRITE #undef E1_DIR_WRITE
#define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE) #define E1_DIR_WRITE(STATE) stepperE1.Step_Clock(STATE)
#undef E1_DIR_READ #undef E1_DIR_READ
#define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR) #define E1_DIR_READ (stepperE1.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(E2_IS_L6470) #if ENABLED(E2_IS_L6470)
extern L6470 stepperE2; extern L6470 stepperE2;
#undef E2_ENABLE_INIT #undef E2_ENABLE_INIT
#define E2_ENABLE_INIT ((void)0) #define E2_ENABLE_INIT ((void)0)
#undef E2_ENABLE_WRITE #undef E2_ENABLE_WRITE
#define E2_ENABLE_WRITE(STATE) (if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();) #define E2_ENABLE_WRITE(STATE) (if(STATE) stepperE2.Step_Clock(stepperE2.getStatus() & STATUS_HIZ); else stepperE2.softFree();)
#undef E2_ENABLE_READ #undef E2_ENABLE_READ
#define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ) #define E2_ENABLE_READ (stepperE2.getStatus() & STATUS_HIZ)
#undef E2_DIR_INIT #undef E2_DIR_INIT
#define E2_DIR_INIT ((void)0) #define E2_DIR_INIT ((void)0)
#undef E2_DIR_WRITE #undef E2_DIR_WRITE
#define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE) #define E2_DIR_WRITE(STATE) stepperE2.Step_Clock(STATE)
#undef E2_DIR_READ #undef E2_DIR_READ
#define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR) #define E2_DIR_READ (stepperE2.getStatus() & STATUS_DIR)
#endif #endif
#if ENABLED(E3_IS_L6470) #if ENABLED(E3_IS_L6470)
extern L6470 stepperE3; extern L6470 stepperE3;
#undef E3_ENABLE_INIT #undef E3_ENABLE_INIT
#define E3_ENABLE_INIT ((void)0) #define E3_ENABLE_INIT ((void)0)
#undef E3_ENABLE_WRITE #undef E3_ENABLE_WRITE
#define E3_ENABLE_WRITE(STATE) (if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();) #define E3_ENABLE_WRITE(STATE) (if(STATE) stepperE3.Step_Clock(stepperE3.getStatus() & STATUS_HIZ); else stepperE3.softFree();)
#undef E3_ENABLE_READ #undef E3_ENABLE_READ
#define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ) #define E3_ENABLE_READ (stepperE3.getStatus() & STATUS_HIZ)
#undef E3_DIR_INIT #undef E3_DIR_INIT
#define E3_DIR_INIT ((void)0) #define E3_DIR_INIT ((void)0)
#undef E3_DIR_WRITE #undef E3_DIR_WRITE
#define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE) #define E3_DIR_WRITE(STATE) stepperE3.Step_Clock(STATE)
#undef E3_DIR_READ #undef E3_DIR_READ
#define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR) #define E3_DIR_READ (stepperE3.getStatus() & STATUS_DIR)
#endif #endif
#endif //HAVE_L6470DRIVER #endif //HAVE_L6470DRIVER