Merge pull request #11196 from thinkyhead/bf2_fix_m914_sgt

[2.0.x] No M914 or SGT with non-sensorless axes
This commit is contained in:
Scott Lahteine 2018-07-04 02:34:48 -05:00 committed by GitHub
commit 6837252fba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 61 deletions

View file

@ -522,23 +522,23 @@
// Specify here all the endstop connectors that are connected to any endstop or probe. // Specify here all the endstop connectors that are connected to any endstop or probe.
// Almost all printers will be using one per axis. Probes will use one or more of the // Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes. // extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
#define USE_XMIN_PLUG //#define USE_XMIN_PLUG
#define USE_YMIN_PLUG //#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG #define USE_ZMIN_PLUG
//#define USE_XMAX_PLUG #define USE_XMAX_PLUG
//#define USE_YMAX_PLUG #define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG //#define USE_ZMAX_PLUG
// Enable pullup for all endstops to prevent a floating state // Enable pullup for all endstops to prevent a floating state
//#define ENDSTOPPULLUPS //#define ENDSTOPPULLUPS
#if DISABLED(ENDSTOPPULLUPS) #if DISABLED(ENDSTOPPULLUPS)
// Disable ENDSTOPPULLUPS to set pullups individually // Disable ENDSTOPPULLUPS to set pullups individually
//#define ENDSTOPPULLUP_XMAX #define ENDSTOPPULLUP_XMAX
//#define ENDSTOPPULLUP_YMAX #define ENDSTOPPULLUP_YMAX
#define ENDSTOPPULLUP_ZMAX // open pin, inverted //#define ENDSTOPPULLUP_ZMAX // open pin, inverted
#define ENDSTOPPULLUP_XMIN // open pin, inverted //#define ENDSTOPPULLUP_XMIN // open pin, inverted
#define ENDSTOPPULLUP_YMIN // open pin, inverted //#define ENDSTOPPULLUP_YMIN // open pin, inverted
//#define ENDSTOPPULLUP_ZMIN #define ENDSTOPPULLUP_ZMIN
//#define ENDSTOPPULLUP_ZMIN_PROBE //#define ENDSTOPPULLUP_ZMIN_PROBE
#endif #endif

View file

@ -268,58 +268,70 @@ void GcodeSuite::M912() {
const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63); const int8_t value = (int8_t)constrain(parser.value_int(), -64, 63);
report = false; report = false;
switch (i) { switch (i) {
case X_AXIS: #if X_SENSORLESS
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) case X_AXIS:
if (index == 0) TMC_SET_SGT(X); #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
#endif if (index == 0) TMC_SET_SGT(X);
#if ENABLED(X2_IS_TMC2130) #endif
if (index == 1) TMC_SET_SGT(X2); #if ENABLED(X2_IS_TMC2130)
#endif if (index == 1) TMC_SET_SGT(X2);
break; #endif
case Y_AXIS: break;
#if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) #endif
if (index == 0) TMC_SET_SGT(Y); #if Y_SENSORLESS
#endif case Y_AXIS:
#if ENABLED(Y2_IS_TMC2130) #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
if (index == 1) TMC_SET_SGT(Y2); if (index == 0) TMC_SET_SGT(Y);
#endif #endif
break; #if ENABLED(Y2_IS_TMC2130)
case Z_AXIS: if (index == 1) TMC_SET_SGT(Y2);
#if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) #endif
if (index == 0) TMC_SET_SGT(Z); break;
#endif #endif
#if ENABLED(Z2_IS_TMC2130) #if Z_SENSORLESS
if (index == 1) TMC_SET_SGT(Z2); case Z_AXIS:
#endif #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
break; if (index == 0) TMC_SET_SGT(Z);
#endif
#if ENABLED(Z2_IS_TMC2130)
if (index == 1) TMC_SET_SGT(Z2);
#endif
break;
#endif
} }
} }
if (report) LOOP_XYZ(i) switch (i) { if (report) LOOP_XYZ(i) switch (i) {
case X_AXIS: #if X_SENSORLESS
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) case X_AXIS:
TMC_SAY_SGT(X); #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
#endif TMC_SAY_SGT(X);
#if ENABLED(X2_IS_TMC2130) #endif
TMC_SAY_SGT(X2); #if ENABLED(X2_IS_TMC2130)
#endif TMC_SAY_SGT(X2);
break; #endif
case Y_AXIS: break;
#if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) #endif
TMC_SAY_SGT(Y); #if Y_SENSORLESS
#endif case Y_AXIS:
#if ENABLED(Y2_IS_TMC2130) #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
TMC_SAY_SGT(Y2); TMC_SAY_SGT(Y);
#endif #endif
break; #if ENABLED(Y2_IS_TMC2130)
case Z_AXIS: TMC_SAY_SGT(Y2);
#if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) #endif
TMC_SAY_SGT(Z); break;
#endif #endif
#if ENABLED(Z2_IS_TMC2130) #if Z_SENSORLESS
TMC_SAY_SGT(Z2); case Z_AXIS:
#endif #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
break; TMC_SAY_SGT(Z);
#endif
#if ENABLED(Z2_IS_TMC2130)
TMC_SAY_SGT(Z2);
#endif
break;
#endif
} }
} }
#endif // SENSORLESS_HOMING #endif // SENSORLESS_HOMING

View file

@ -249,7 +249,7 @@
#if ENABLED(SENSORLESS_HOMING) #if ENABLED(SENSORLESS_HOMING)
#define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY); #define TMC_INIT_SGT(P,Q) stepper##Q.sgt(P##_HOMING_SENSITIVITY);
#ifdef X_HOMING_SENSITIVITY #if X_SENSORLESS
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)
stepperX.sgt(X_HOMING_SENSITIVITY); stepperX.sgt(X_HOMING_SENSITIVITY);
#endif #endif
@ -257,7 +257,7 @@
stepperX2.sgt(X_HOMING_SENSITIVITY); stepperX2.sgt(X_HOMING_SENSITIVITY);
#endif #endif
#endif #endif
#ifdef Y_HOMING_SENSITIVITY #if Y_SENSORLESS
#if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(Y_IS_TMC2130) || ENABLED(IS_TRAMS)
stepperY.sgt(Y_HOMING_SENSITIVITY); stepperY.sgt(Y_HOMING_SENSITIVITY);
#endif #endif
@ -265,7 +265,7 @@
stepperY2.sgt(Y_HOMING_SENSITIVITY); stepperY2.sgt(Y_HOMING_SENSITIVITY);
#endif #endif
#endif #endif
#ifdef Z_HOMING_SENSITIVITY #if Z_SENSORLESS
#if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS) #if ENABLED(Z_IS_TMC2130) || ENABLED(IS_TRAMS)
stepperZ.sgt(Z_HOMING_SENSITIVITY); stepperZ.sgt(Z_HOMING_SENSITIVITY);
#endif #endif