X_SENSORLESS includes AXIS_HAS_STALLGUARD

This commit is contained in:
Scott Lahteine 2019-09-30 21:45:00 -05:00
parent e3fd0519b3
commit 806d64e1bf
4 changed files with 24 additions and 27 deletions

View File

@ -977,7 +977,10 @@
#define X_SENSORLESS (AXIS_HAS_STALLGUARD(X) && defined(X_STALL_SENSITIVITY))
#define X2_SENSORLESS (AXIS_HAS_STALLGUARD(X2) && defined(X2_STALL_SENSITIVITY))
#define Y_SENSORLESS (AXIS_HAS_STALLGUARD(Y) && defined(Y_STALL_SENSITIVITY))
#define Y2_SENSORLESS (AXIS_HAS_STALLGUARD(Y2) && defined(Y2_STALL_SENSITIVITY))
#define Z_SENSORLESS (AXIS_HAS_STALLGUARD(Z) && defined(Z_STALL_SENSITIVITY))
#define Z2_SENSORLESS (AXIS_HAS_STALLGUARD(Z2) && defined(Z2_STALL_SENSITIVITY))
#define Z3_SENSORLESS (AXIS_HAS_STALLGUARD(Z3) && defined(Z3_STALL_SENSITIVITY))
#if ENABLED(SPI_ENDSTOPS)
#define X_SPI_SENSORLESS X_SENSORLESS
#define Y_SPI_SENSORLESS Y_SENSORLESS

View File

@ -35,21 +35,21 @@ void StepperBumpSensitivityScreen::onRedraw(draw_mode_t what) {
w.precision(0, BaseNumericAdjustmentScreen::DEFAULT_LOWEST);
w.heading( GET_TEXTF(HOME_SENSE));
w.color(x_axis) .adjuster( 2, GET_TEXTF(AXIS_X), getTMCBumpSensitivity(X),
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
#if X_SENSORLESS
true
#else
false
#endif
);
w.color(y_axis) .adjuster( 4, GET_TEXTF(AXIS_Y), getTMCBumpSensitivity(Y),
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
#if Y_SENSORLESS
true
#else
false
#endif
);
w.color(z_axis) .adjuster( 6, GET_TEXTF(AXIS_Z), getTMCBumpSensitivity(Z),
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
#if Z_SENSORLESS
true
#else
false

View File

@ -516,13 +516,13 @@ namespace ExtUI {
int getTMCBumpSensitivity(const axis_t axis) {
switch (axis) {
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
#if X_SENSORLESS
case X: return stepperX.homing_threshold();
#endif
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
#if Y_SENSORLESS
case Y: return stepperY.homing_threshold();
#endif
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
#if Z_SENSORLESS
case Z: return stepperZ.homing_threshold();
#endif
default: return 0;
@ -531,18 +531,16 @@ namespace ExtUI {
void setTMCBumpSensitivity(const float value, const axis_t axis) {
switch (axis) {
#if X_SENSORLESS && AXIS_HAS_STALLGUARD(X)
case X: stepperX.homing_threshold(value); break;
#else
UNUSED(value);
#endif
#if Y_SENSORLESS && AXIS_HAS_STALLGUARD(Y)
case Y: stepperY.homing_threshold(value); break;
#else
UNUSED(value);
#endif
#if Z_SENSORLESS && AXIS_HAS_STALLGUARD(Z)
case Z: stepperZ.homing_threshold(value); break;
#if X_SENSORLESS || Y_SENSORLESS || Z_SENSORLESS
#if X_SENSORLESS
case X: stepperX.homing_threshold(value); break;
#endif
#if Y_SENSORLESS
case Y: stepperY.homing_threshold(value); break;
#endif
#if Z_SENSORLESS
case Z: stepperZ.homing_threshold(value); break;
#endif
#else
UNUSED(value);
#endif

View File

@ -3246,27 +3246,23 @@ void MarlinSettings::reset() {
SERIAL_EOL();
#endif
#define HAS_X2_SENSORLESS (defined(X_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(X2))
#define HAS_Y2_SENSORLESS (defined(Y_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Y2))
#define HAS_Z2_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z2))
#define HAS_Z3_SENSORLESS (defined(Z_STALL_SENSITIVITY) && AXIS_HAS_STALLGUARD(Z3))
#if HAS_X2_SENSORLESS || HAS_Y2_SENSORLESS || HAS_Z2_SENSORLESS
#if X2_SENSORLESS || Y2_SENSORLESS || Z2_SENSORLESS
CONFIG_ECHO_START();
say_M914();
SERIAL_ECHOPGM(" I1");
#if HAS_X2_SENSORLESS
#if X2_SENSORLESS
SERIAL_ECHOPAIR(" X", stepperX2.homing_threshold());
#endif
#if HAS_Y2_SENSORLESS
#if Y2_SENSORLESS
SERIAL_ECHOPAIR(" Y", stepperY2.homing_threshold());
#endif
#if HAS_Z2_SENSORLESS
#if Z2_SENSORLESS
SERIAL_ECHOPAIR(" Z", stepperZ2.homing_threshold());
#endif
SERIAL_EOL();
#endif
#if HAS_Z3_SENSORLESS
#if Z3_SENSORLESS
CONFIG_ECHO_START();
say_M914();
SERIAL_ECHOLNPAIR(" I2 Z", stepperZ3.homing_threshold());